/*
Theme Name: BookDrop Store Theme
Theme URI: https://github.com/bookdrop/storefront
Author: BookDrop Team
Author URI: https://bookdrop.local
Description: Giao diện nhà sách trực tuyến hiện đại, responsive, tối ưu chuyển đổi lấy cảm hứng từ Fahasa và Tiki dành riêng cho BookDrop.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: bookdrop-theme
*/

:root {
    --primary: #1e3a8a;       /* Deep Indigo */
    --primary-dark: #172554;
    --primary-light: #3b82f6;
    --accent: #f59e0b;        /* Warm Gold/Amber */
    --danger: #dc2626;        /* Sale Red */
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.5;
    font-size: 15px;
}

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

a:hover {
    color: var(--primary-light);
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
}

/* TOPBAR */
.site-topbar {
    background-color: var(--primary-dark);
    color: #cbd5e1;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* HEADER */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-main {
    padding: 14px 0;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.site-logo svg {
    width: 34px;
    height: 34px;
    color: var(--primary);
}

.site-logo span {
    color: var(--danger);
}

/* SEARCH BAR */
.header-search {
    flex: 1;
    max-width: 650px;
}

.search-form {
    display: flex;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.search-category-select {
    border: none;
    border-right: 1px solid var(--border);
    padding: 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    background: #f8fafc;
    outline: none;
    cursor: pointer;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    font-size: 14px;
    outline: none;
}

.search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* HEADER ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
}

.action-icon {
    font-size: 22px;
    color: var(--primary);
}

.action-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* NAVBAR */
.site-nav {
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 90;
}

.nav-content {
    display: flex;
    align-items: center;
    height: 46px;
    gap: 20px;
    position: relative;
}

.cat-dropdown-wrapper {
    position: relative;
    flex-shrink: 0;
}

.cat-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    color: var(--primary);
    padding: 8px 14px;
    background: #eff6ff;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.cat-dropdown-trigger:hover {
    background: #dbeafe;
}

.main-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 6px;
    margin: 0;
    padding: 0;
    font-size: 13.5px;
    font-weight: 600;
    flex: 1;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-menu::-webkit-scrollbar {
    display: none;
}

.main-menu > li {
    flex-shrink: 0;
    position: relative;
}

.main-menu > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.main-menu > li > a:hover {
    color: var(--primary);
    background: #f8fafc;
}

.main-menu > li.menu-highlight > a {
    color: var(--danger);
    font-weight: 700;
}

.main-menu > li.menu-highlight > a:hover {
    background: #fef2f2;
}

/* Submenu dropdown inside main-menu */
.main-menu .has-dropdown > a::after {
    content: " ▾";
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.6;
}

.main-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
    border-radius: 8px;
    list-style: none;
    padding: 6px 0;
    z-index: 999;
}

.main-menu .has-dropdown:hover .sub-menu {
    display: block;
}

.main-menu .sub-menu li {
    padding: 0;
}

.main-menu .sub-menu li a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}

.main-menu .sub-menu li a:hover {
    background: #f8fafc;
    color: var(--primary);
}

/* HERO SECTION */
.hero-section {
    padding: 20px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 16px;
}

.hero-banner-main {
    background: linear-gradient(135deg, #1e3a8a, #0284c7);
    color: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-banner-main h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.25;
}

.hero-banner-main p {
    font-size: 16px;
    color: #e0f2fe;
    margin-bottom: 24px;
    max-width: 480px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #0f172a;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 8px;
    width: fit-content;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    transition: transform 0.15s, background 0.15s;
}

.hero-cta:hover {
    background: #fbbf24;
    transform: translateY(-2px);
    color: #0f172a;
}

.hero-side-banners {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-banner {
    border-radius: 12px;
    padding: 24px;
    color: #fff;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow);
}

.side-banner-1 {
    background: linear-gradient(135deg, #059669, #10b981);
}

.side-banner-2 {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.side-banner h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.side-banner p {
    font-size: 13px;
    opacity: 0.9;
}

/* VALUE PROPS */
.value-props {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: #fff;
    padding: 18px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 20px 0 30px;
}

.prop-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prop-icon {
    font-size: 26px;
    color: var(--primary);
    background: #eff6ff;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.prop-title {
    font-weight: 700;
    font-size: 14px;
}

.prop-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* PRODUCT SECTION */
.section-block {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
}

.section-title-tag {
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* PRODUCT GRID */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.book-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.book-badge-sale {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.book-cover-wrap {
    background: #f8fafc;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.book-cover-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.12);
    transition: transform 0.2s;
}

.book-card:hover .book-cover-wrap img {
    transform: scale(1.03);
}

.book-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-author {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.book-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
    line-height: 1.45;
    margin-bottom: 8px;
}

.book-price-block {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.book-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--danger);
}

.book-stock-tag {
    font-size: 11px;
    color: #059669;
    font-weight: 600;
    margin-bottom: 10px;
}

.book-actions {
    display: flex;
    gap: 6px;
}

.btn-add-cart, .btn-buy-now {
    flex: 1;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.btn-add-cart {
    background: #f1f5f9;
    color: var(--primary);
    border: 1px solid #cbd5e1;
}

.btn-add-cart:hover {
    background: #e2e8f0;
}

.btn-buy-now {
    background: var(--danger);
    color: #fff;
}

.btn-buy-now:hover {
    background: #b91c1c;
    color: #fff;
}

/* SINGLE PRODUCT PAGE */
.single-product-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin: 25px auto;
    box-shadow: var(--shadow);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 36px;
}

.product-gallery {
    text-align: center;
}

.product-gallery img {
    max-width: 100%;
    max-height: 520px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-meta-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.product-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-byline {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.product-price-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 20px 0;
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.product-price-current {
    font-size: 30px;
    font-weight: 800;
    color: var(--danger);
}

.product-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.product-specs-table th, .product-specs-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.product-specs-table th {
    background: #f8fafc;
    width: 180px;
    color: var(--text-muted);
    font-weight: 600;
}

.product-buy-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.btn-lg-buy-now {
    background: var(--danger);
    color: #fff;
    flex: 1;
    border: none;
}

.btn-lg-buy-now:hover {
    background: #b91c1c;
    color: #fff;
}

.btn-lg-add-cart {
    background: #eff6ff;
    color: var(--primary);
    border: 2px solid var(--primary);
    flex: 1;
}

.btn-lg-add-cart:hover {
    background: #dbeafe;
}

/* WOOCOMMERCE FORM / CHECKOUT STYLING */
.woocommerce-checkout, .woocommerce-cart {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    margin: 25px 0;
    box-shadow: var(--shadow);
}

.woocommerce-billing-fields h3, .woocommerce-order-review-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.form-row input.input-text, .form-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.woocommerce-checkout #order_review {
    background: #f8fafc;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

button#place_order, .woocommerce-cart .checkout-button {
    background: var(--danger) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 14px 24px !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    width: 100% !important;
}

button#place_order:hover, .woocommerce-cart .checkout-button:hover {
    background: #b91c1c !important;
}

/* FOOTER */
.site-footer {
    background: #111827;
    color: #9ca3af;
    padding: 48px 0 20px;
    margin-top: 40px;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 36px;
}

.footer-col h4 {
    color: #f3f4f6;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
    line-height: 2;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #1f2937;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
}

/* MOBILE BOTTOM BAR */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--primary);
}

/* RESPONSIVE */
.bookdrop-archive-layout { display:grid; grid-template-columns:240px minmax(0,1fr); gap:24px; margin-top:16px; }
.shop-main { min-width:0; }
@media (max-width: 991px) {
    .bookdrop-archive-layout { grid-template-columns:minmax(0,1fr); }
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .value-props {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-price-box { flex-wrap: wrap; align-items: center; }
    .product-price-box > span:last-child { flex-basis: 100%; margin-left: 0 !important; }
    .site-topbar, .site-nav {
        display: none;
    }
    .header-main {
        flex-wrap: wrap;
        gap: 12px;
    }
    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .search-category-select {
        display: none;
    }
    .value-props {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .mobile-bottom-bar {
        display: block;
    }
    body {
        padding-bottom: 60px;
    }
}


/* CATEGORY PRIORITY & SUB-ATTRIBUTE STYLING */
.book-cat-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}
.book-cat-tag:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.book-publisher-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.category-pill-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 0 24px;
    scrollbar-width: none;
}
.category-pill-nav::-webkit-scrollbar {
    display: none;
}
.category-pill-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}
.category-pill-item:hover, .category-pill-item.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(30, 58, 138, 0.2);
}
.category-pill-count {
    background: #f1f5f9;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    transition: all 0.2s ease;
}
.category-pill-item:hover .category-pill-count, .category-pill-item.active .category-pill-count {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
}


/* CATEGORY DROPDOWN MENU */
.cat-dropdown-wrapper:hover .cat-dropdown-menu {
    display: block !important;
}
.cat-dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--primary) !important;
}
