/* ============================================================
   main.css — Style chính cho trang khách hàng Shop Thần Nông
   Màu chủ đạo: Nâu đất (#8b5e3c) — mộc mạc, sang trọng, tự nhiên
   ============================================================ */

/* ===== 1. Google Fonts & Reset ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* ── Bảng màu Nâu Đất (Earth Brown) chủ đạo ── */
    --color-primary:       #8b5e3c;
    --color-primary-dark:  #5c3d25;
    --color-primary-light: #fbf8f5;
    --color-accent:        #d4a373;
    --color-accent-dark:   #a98467;
    --color-text:          #2b2521;
    --color-text-light:    #7c7068;
    --color-bg:            #f7f3ee;
    --color-white:         #ffffff;
    --color-border:        #e6dfd5;

    /* ── Typography ── */
    --font-main:    'Inter', sans-serif;
    --font-heading: 'Playfair Display', serif;

    /* ── Spacing & Radius ── */
    --radius-sm:  6px;
    --radius-md:  14px;
    --radius-lg:  22px;
    --shadow-sm:  0 2px 12px rgba(139,94,60,.06);
    --shadow-md:  0 8px 28px rgba(139,94,60,.12);
    --shadow-lg:  0 16px 48px rgba(139,94,60,.16);
    --transition: all .25s ease;
}

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

/* ===== 2. NAVBAR ===== */
.navbar-thannong {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;
    box-shadow: var(--shadow-md);
    padding: .75rem 0;
}
.navbar-thannong .navbar-brand { font-family: var(--font-heading); font-size: 1.5rem; color: white !important; }
.navbar-thannong .navbar-brand img {
    height: 44px; margin-right: 10px; border-radius: 50%;
    background: #ffffff !important;   /* nền trắng 100% để logo nổi */
    padding: 4px;
    border: 2px solid rgba(255,255,255,.5);
}
.navbar-thannong .nav-link { color: rgba(255,255,255,.9) !important; font-weight: 500; transition: var(--transition); }
.navbar-thannong .nav-link:hover { color: var(--color-accent) !important; }

/* Badge giỏ hàng */
.nav-cart-badge { position: relative; display: inline-block; }
#cartBadge {
    position: absolute; top: -8px; right: -10px;
    background: var(--color-accent); color: white;
    font-size: .62rem; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ===== 3. HERO ===== */
.hero-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, #a98467 55%, var(--color-primary-dark) 100%) !important;
    color: white !important;
    padding: 90px 0 70px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; top: -30%; right: -10%;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
}

/* ===== 4. Section Titles ===== */
.section-title {
    font-family: var(--font-heading);
    font-size: 2rem; font-weight: 700;
    color: var(--color-primary-dark); margin-bottom: .5rem;
}
.section-title::after {
    content: ''; display: block; width: 50px; height: 3px;
    background: var(--color-accent); margin-top: .5rem; border-radius: 2px;
}
.section-title.text-center::after { margin-left: auto; margin-right: auto; }

/* ===== 5. PRODUCT CARDS ===== */
.product-card {
    background: white; border-radius: var(--radius-md);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: var(--transition); border: 1px solid var(--color-border);
    height: 100%; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--color-primary-light); }

.product-card-img-wrap {
    overflow: hidden; height: 220px;
    background: #f0f4ff;
    display: flex; align-items: center; justify-content: center;
}
.product-card-img-wrap img {
    width: 100%; height: 100%; object-fit: contain;
    mix-blend-mode: multiply; transition: transform .4s ease;
}
.product-card:hover .product-card-img-wrap img { transform: scale(1.05); }

.product-card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.product-card-category {
    font-size: .72rem; font-weight: 600; color: var(--color-primary);
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: .3rem;
}
.product-card-title {
    font-size: .95rem; font-weight: 600; color: var(--color-text);
    margin-bottom: .5rem; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; height: 2.8rem;
}
.product-card-price { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); margin-bottom: .8rem; }
.product-rating { color: var(--color-accent); font-size: .85rem; margin-bottom: .6rem; }

/* Nút thêm giỏ hàng */
.btn-add-to-cart {
    background: var(--color-primary); color: white;
    border: none; border-radius: var(--radius-sm);
    padding: .55rem 1rem; font-size: .9rem; font-weight: 500;
    width: 100%; cursor: pointer; transition: var(--transition);
}
.btn-add-to-cart:hover { background: var(--color-primary-dark); transform: scale(1.02); }

/* ===== 6. FILTER SIDEBAR ===== */
.filter-panel {
    background: white; border-radius: var(--radius-md);
    padding: 1.5rem; box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    position: sticky; top: 90px; z-index: 10;
}
.filter-panel h5 { font-weight: 600; color: var(--color-primary-dark); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--color-primary-light); }

/* ===== 7. BUTTONS ===== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white; border: none; border-radius: var(--radius-sm);
    padding: .65rem 1.5rem; font-weight: 600; cursor: pointer; transition: var(--transition);
    box-shadow: 0 3px 12px rgba(139,94,60,.3);
    text-decoration: none; display: inline-flex; align-items: center;
}
.btn-primary-custom:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139,94,60,.4); color: white; }
.btn-accent { background: var(--color-accent); color: white; border: none; border-radius: var(--radius-sm); padding: .65rem 1.5rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.btn-accent:hover { background: var(--color-accent-dark); color: white; }

/* ===== 8. CART PAGE ===== */
.cart-summary-box { background: white; border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); position: sticky; top: 80px; }
.cart-total-value { font-size: 1.6rem; font-weight: 700; color: var(--color-primary); }

/* ===== 9. CHECKOUT ===== */
.checkout-form-card { background: white; border-radius: var(--radius-md); padding: 2rem; box-shadow: var(--shadow-sm); }
.checkout-order-summary { background: var(--color-primary-light); border-radius: var(--radius-md); padding: 1.5rem; border: 1px solid rgba(139,94,60,.15); }

/* ===== 10. FOOTER ===== */
.site-footer {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #162d50 100%);
    color: rgba(255,255,255,.85); padding: 3rem 0 1.5rem; margin-top: 4rem;
}
.site-footer h6 { color: var(--color-accent); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,.7); text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: var(--color-accent); }
.footer-divider { border-color: rgba(255,255,255,.1); margin: 1.5rem 0; }

/* ===== 11. CATEGORY TABS ===== */
.category-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.category-tab {
    padding: .4rem 1rem; border-radius: 20px; font-size: .85rem; font-weight: 500;
    cursor: pointer; transition: var(--transition);
    border: 2px solid var(--color-primary); color: var(--color-primary); background: transparent;
}
.category-tab:hover, .category-tab.active { background: var(--color-primary); color: white; }

/* ===== 12. BADGES ===== */
.badge-category {
    background: var(--color-primary-light); color: var(--color-primary-dark);
    font-size: .72rem; padding: .25rem .6rem; border-radius: 12px; font-weight: 500;
}

/* ===== 13. PAGINATION ===== */
.pagination-custom .page-link { color: var(--color-primary); border-color: var(--color-primary-light); }
.pagination-custom .page-item.active .page-link { background: var(--color-primary); border-color: var(--color-primary); color: white; }

/* ===== 14. ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp .5s ease forwards; }
.product-card:nth-child(1){animation-delay:.05s}.product-card:nth-child(2){animation-delay:.10s}
.product-card:nth-child(3){animation-delay:.15s}.product-card:nth-child(4){animation-delay:.20s}

/* ===== 15. RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-section { padding: 60px 0 50px; }
    .hero-section h1 { font-size: 2rem !important; }
    .product-card-img-wrap { height: 180px; }
    .filter-panel { position: static; }
}
@media (max-width: 576px) {
    .hero-section h1 { font-size: 1.7rem !important; }
    .product-card-img-wrap { height: 160px; }
}
