/*
Theme Name: Veganic Theme
Author: Your Name
Description: Custom theme phong cách tối giản cho cửa hàng thực phẩm hữu cơ, lấy cảm hứng từ Ajuma Garden.
Version: 1.0
*/

/* -------------------------------------------------------------------------
 * WooCommerce grid (scoped) - avoid global !important and floats
 * Use `.veganic-woocommerce` wrapper class in templates when possible.
 * ---------------------------------------------------------------------- */
.veganic-woocommerce .woocommerce ul.products,
.veganic-woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}

.veganic-woocommerce .woocommerce ul.products::before,
.veganic-woocommerce .woocommerce ul.products::after,
.veganic-woocommerce ul.products::before,
.veganic-woocommerce ul.products::after {
    content: none !important;
    display: none !important;
}

@media (min-width: 640px) {
    .veganic-woocommerce .woocommerce ul.products,
    .veganic-woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .veganic-woocommerce .woocommerce ul.products,
    .veganic-woocommerce ul.products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.veganic-woocommerce .woocommerce ul.products li.product,
.veganic-woocommerce ul.products li.product {
    width: 100%;
    margin: 0;
    float: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.veganic-woocommerce .woocommerce ul.products li.product .woocommerce-LoopProduct-link,
.veganic-woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.veganic-woocommerce .woocommerce ul.products li.product a img,
.veganic-woocommerce ul.products li.product a img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
}

.veganic-woocommerce .woocommerce ul.products li.product .woocommerce-loop-product__title,
.veganic-woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 3.2em;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.veganic-woocommerce .woocommerce ul.products li.product .price,
.veganic-woocommerce ul.products li.product .price {
    min-height: 1.6em;
}

.veganic-woocommerce .woocommerce ul.products li.product .button,
.veganic-woocommerce .woocommerce ul.products li.product .added_to_cart,
.veganic-woocommerce ul.products li.product .button,
.veganic-woocommerce ul.products li.product .added_to_cart {
    margin-top: auto;
}

.veganic-single-product .woocommerce-product-gallery__image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
}

/* -------------------------------------------------------------------------
 * Homepage latest-products stability
 * Force consistent product cards even when source images have mixed ratios.
 * ---------------------------------------------------------------------- */
.latest-products .veganic-woocommerce .woocommerce ul.products,
.latest-products .veganic-woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
}

.latest-products .veganic-woocommerce .woocommerce ul.products::before,
.latest-products .veganic-woocommerce .woocommerce ul.products::after,
.latest-products .veganic-woocommerce ul.products::before,
.latest-products .veganic-woocommerce ul.products::after {
    content: none !important;
    display: none !important;
}

@media (min-width: 640px) {
    .latest-products .veganic-woocommerce .woocommerce ul.products,
    .latest-products .veganic-woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) {
    .latest-products .veganic-woocommerce .woocommerce ul.products,
    .latest-products .veganic-woocommerce ul.products {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

.latest-products .veganic-woocommerce .woocommerce ul.products li.product,
.latest-products .veganic-woocommerce ul.products li.product {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column;
    height: 100%;
}

.latest-products .veganic-woocommerce .woocommerce ul.products li.product a img,
.latest-products .veganic-woocommerce ul.products li.product a img {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* -------------------------------------------------------------------------
 * 1. KHỞI TẠO & BIẾN MÀU SẮC (CSS Variables)
 * ------------------------------------------------------------------------- */
:root {
    --primary-color: #116030;    /* Xanh lá cây đậm đặc trưng */
    --secondary-color: #A3B899;  /* Xanh lá nhạt/pastel */
    --text-color: #333333;       /* Màu chữ chính (Xám đen, không dùng đen tuyền) */
    --text-light: #777777;       /* Chữ phụ, mô tả ngắn */
    --bg-color: #FFFFFF;         /* Nền chính */
    --bg-light: #F9F9F9;         /* Nền phụ cho khối, footer */
    --border-color: #ECECEC;     /* Đường kẻ viền mảnh */
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Breakpoints for consistent media queries */
    --bp-sm: 640px;
    --bp-md: 768px;
    --bp-lg: 1024px;
}
.text-primary{
    color: var(--primary-color) !important;
}
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    transition: background-color 0.3s ease;
}
.btn-primary:hover {
    background-color: #1f3f2f; /* Màu xanh đậm hơn khi hover */
}
.bg-primary {
    background-color: var(--primary-color) !important;
}
.btn-outline-primary {
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    transition: all 0.3s ease;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.homepage-wrapper {
    background-color: var(--bg-light);
}

.section-intro {
    max-width: 720px;
}

.contact-container {
    max-width: 1140px;
}

.contact-wrapper {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbf5 100%);
}


.partner-logo {
    max-height: 200px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.partner-logos:hover .partner-logo {
    opacity: 0.85;
}

.post-thumb-image {
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .post-thumb-image {
    transform: scale(1.05);
}

.blog-title,
.blog-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-title {
    -webkit-line-clamp: 2;
}

.blog-excerpt {
    -webkit-line-clamp: 3;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-group-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbf5 100%);
}

.category-group-sidebar {
    min-height: 100%;
}

.category-group-image-wrap {
    aspect-ratio: 4 / 3;
    background: #f3f7ef;
    border: 1px solid #e8efe0;
}

.category-group-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-group-image.placeholder {
    min-height: 220px;
    padding: 1rem;
    text-align: center;
}

.category-group-card .veganic-woocommerce ul.products {
    gap: 1rem;
}

.category-group-card .veganic-woocommerce ul.products li.product {
    border: 1px solid #eef3ea;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff;
}

@media (max-width: 991px) {
    .category-group-sidebar {
        margin-bottom: 0.5rem;
    }
}

/* CONTAINER CHUNG */
.vg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Override Bootstrap .container for theme consistency */
.site-content .container,
.site-footer .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.news-page__hero-card {
    max-width: 780px;
    background: linear-gradient(135deg, #ffffff 0%, #f4f9ef 100%);
    border: 1px solid #e4eed9;
    border-radius: 28px;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 18px 50px rgba(17, 96, 48, 0.08);
}

.news-page__eyebrow {
    color: var(--primary-color);
    background: rgba(17, 96, 48, 0.08);
    letter-spacing: 0.08em;
}

.news-page__intro {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.news-page__intro > *:last-child {
    margin-bottom: 0;
}

.news-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 1rem 2.5rem rgba(16, 24, 40, 0.12) !important;
}

.news-card__media {
    color: inherit;
}

.news-card__placeholder {
    background: linear-gradient(135deg, #eff7e7 0%, #dcebd0 100%);
    letter-spacing: 0.08em;
}

.news-card__excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.news-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #dbe8cf;
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.news-pagination .page-numbers.current,
.news-pagination .page-numbers:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.news-empty {
    max-width: 640px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .news-page__hero-card {
        padding: 3.5rem;
    }
}

/* HEADER NAVIGATION */
.site-header {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 999;
}

.site-logo img {
    max-height: 50px;
}

.site-logo .navbar-brand {
    margin-bottom: 0;
    letter-spacing: 0.2px;
}

.header-actions .cart-count {
    min-width: 1.3rem;
}

/* Main Navigation - HORIZONTAL LAYOUT */
.main-navigation {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation-items {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-navigation ul,
.main-navigation-items {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-navigation li,
.main-navigation-items li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

/* Navigation links styling */
nav a,
.nav-link,
.main-navigation a,
.main-navigation li a,
.main-navigation li.menu-item > a {
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    color: var(--text-color) !important;
    padding: 10px 14px !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    border-bottom: 2px solid transparent !important;
    white-space: nowrap !important;
    
}
.nav-link{
    color: var(--primary-color) !important;
}
.container h2 {
    color: var(--primary-color) !important;
}
.footer-contact{
    font-weight: 700 !important;
}

a.product-cat-link {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    padding: 10px 14px !important;
    white-space: nowrap !important;
    width: fit-content;
    line-height: 1.2;
}

a.product-cat-link > img {
    display: block !important;
    float: none !important;
    width: 24px;
    height: 24px;
    flex: 0 0 auto !important;
    object-fit: cover;
    border-radius: 50%;
}

a.product-cat-link > span {
    display: block !important;
    flex: 0 1 auto !important;
    line-height: 1.2;
}

nav a:hover,
.nav-link:hover,
.main-navigation a:hover,
.main-navigation li a:hover,
.main-navigation li.menu-item > a:hover {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    background-color: rgba(46, 90, 68, 0.05) !important;
}
/* */
nav a.nav-link,
nav a.product-cat-link{
    color: var(--primary-color) !important;
}
nav a.nav-link:hover,
nav a.product-cat-link:hover{
    color: #93c741 !important;
}
/* */
nav a:focus,
.nav-link:focus,
.main-navigation a:focus,
.main-navigation li a:focus,
.main-navigation li.menu-item > a:focus {
    outline: 2px solid rgba(46, 90, 68, 0.3) !important;
    outline-offset: 4px !important;
    border-radius: 3px !important;
}

/* -------------------------------------------------------------------------
 * 3. TRANG CHỦ (front-page.php) & BANNER
 * ------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.hero-banner {
    background-color: var(--bg-light);
    padding: 100px 0;
    text-align: center;
    margin-bottom: 60px;
}

.hero-banner h1 {
    font-size: 42px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 400;
}

.section-title {
    text-align: center;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 40px;
    position: relative;
    color: var(--primary-color);
}

/* -------------------------------------------------------------------------
 * 4. DANH SÁCH SẢN PHẨM (Lưới 4 cột sang trọng)
 * ------------------------------------------------------------------------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Responsive tweaks */
@media (max-width: var(--bp-md)) {
    .products-grid { gap: 15px; }
    .header-container { height: 70px; }
    .main-navigation { display: none; } /* Cần làm menu dạng hamburger sau */
}

/* Thẻ sản phẩm đơn lẻ */
.product-item {
    background: var(--bg-color);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
    background: #fdfdfd;
}

.product-info {
    text-align: center;
    padding: 10px 0;
}

.product-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-weight: 600;
    color: var(--primary-color);
}

.product-price del {
    color: var(--text-light);
    font-weight: 400;
    font-size: 13px;
    margin-right: 5px;
}

/* Nút mua hàng tinh tế ẩn hiện khi hover */
.add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 10px 0;
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #1f3f2f;
}

/* Accessibility: focus styles for interactive elements */
.add-to-cart-btn:focus,
.header-actions a:focus,
.main-navigation a:focus {
    outline: 3px solid rgba(46,90,68,0.15);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * 5. FOOTER (footer.php)
 * ------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--bg-light);
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-light);
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .footer-widgets { grid-template-columns: 1fr; gap: 25px; }
}

.footer-widget h4 {
    color: var(--primary-color);
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    height: 100%;
}

.footer-widget a {
    color: var(--text-color);
}

.footer-widget a:hover {
    color: var(--primary-color);
}

.newsletter-form input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text-color);
}

.newsletter-form button {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.newsletter-form button:hover {
    background: #1f3f2f;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
}