/*
Theme Name: Tamil Islamic Books
Theme URI: https://tamilislamicbooks.com
Author: Yusuf
Description: A clean, modern WooCommerce theme for Tamil Islamic books with bilingual (Tamil/English) support.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.8
WC requires at least: 8.0
WC tested up to: 9.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tamilislamicbooks
Tags: woocommerce, islamic, books, tamil, bilingual, clean, minimal
*/

/* =============================================
   GOOGLE FONTS
   Loaded via wp_enqueue_style() in functions.php, NOT @import.
   @import blocks rendering and can't be preconnected.
============================================= */

/* =============================================
   CSS VARIABLES
============================================= */
:root {
    --teal:        #1D9E75;
    --teal-light:  #E1F5EE;
    --teal-mid:    #5DCAA5;
    --teal-dark:   #0F6E56;
    --teal-deeper: #085041;
    --ink:         #1a1a1a;
    --muted:       #6b7280;
    --muted-light: #9ca3af;
    --surface:     #f9fafb;
    --border:      rgba(0,0,0,0.08);
    --border-mid:  rgba(0,0,0,0.14);
    --white:       #ffffff;
    --font-serif:  'Lora', Georgia, serif;
    --font-sans:   'DM Sans', system-ui, sans-serif;
    --font-tamil:  'Noto Serif Tamil', serif;
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
    --transition:  0.2s ease;
}

/* =============================================
   RESET & BASE
============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--surface);
}

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

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-dark); }

ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}

.tamil-text { font-family: var(--font-tamil); }

/* =============================================
   LAYOUT
============================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-content { background: var(--white); }

/* =============================================
   HEADER & NAVIGATION
============================================= */
.site-header {
    background: var(--white);
    border-bottom: 0.5px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

/* Logo */
.site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-mark {
    width: 38px;
    height: 38px;
    background: var(--teal);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-mark svg { width: 20px; height: 20px; fill: none; stroke: white; stroke-width: 2; }

.site-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
}

.site-tagline {
    font-family: var(--font-tamil);
    font-size: 11px;
    color: var(--muted);
    display: block;
}

/* Search */
.header-search {
    flex: 1;
    max-width: 360px;
}

.header-search form {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 24px;
    padding: 0 16px;
    height: 38px;
    gap: 8px;
    transition: border-color var(--transition);
}

.header-search form:focus-within {
    border-color: var(--teal-mid);
    background: var(--white);
}

.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--ink);
    outline: none;
}

.header-search input::placeholder { color: var(--muted-light); }

.header-search button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    display: flex;
    align-items: center;
}

/* Nav */
.main-navigation ul {
    display: flex;
    gap: 4px;
}

.main-navigation a {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--teal-dark);
    background: var(--teal-light);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.header-cart-link:hover {
    border-color: var(--teal-mid);
    color: var(--teal-dark);
}

.cart-count {
    background: var(--teal);
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    color: var(--ink);
}

/* =============================================
   HERO SECTION
============================================= */
.hero-section {
    background: linear-gradient(135deg, #f0fdf9 0%, var(--teal-light) 60%, #c8eed9 100%);
    padding: 64px 0 56px;
    overflow: hidden;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 300px; height: 300px;
    background: rgba(29,158,117,0.06);
    border-radius: 50%;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 48px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 0.5px solid var(--teal-mid);
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
    margin-bottom: 6px;
}

.hero-subtitle {
    font-family: var(--font-tamil);
    font-size: 18px;
    color: var(--teal-dark);
    margin-bottom: 14px;
    font-weight: 600;
}

.hero-desc {
    font-size: 15px;
    color: var(--muted);
    max-width: 420px;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-books {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.book-spine-el {
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.5px;
    font-family: var(--font-tamil);
}

/* =============================================
   BUTTONS
============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--teal);
    color: white;
}

.btn-primary:hover {
    background: var(--teal-dark);
    color: white;
}

.btn-outline {
    background: white;
    color: var(--teal-dark);
    border: 0.5px solid var(--teal-mid);
}

.btn-outline:hover {
    background: var(--teal-light);
    border-color: var(--teal);
    color: var(--teal-dark);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

/* =============================================
   STATS BAR
============================================= */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 0.5px solid var(--border);
    border-bottom: 0.5px solid var(--border);
    background: var(--white);
}

.stat-item {
    padding: 18px 24px;
    text-align: center;
    border-right: 0.5px solid var(--border);
}

.stat-item:last-child { border-right: none; }

.stat-num {
    display: block;
    font-size: 22px;
    font-weight: 500;
    font-family: var(--font-serif);
    color: var(--teal-dark);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
}

/* =============================================
   SECTION STYLES
============================================= */
.section {
    padding: 56px 0;
}

.section-alt { background: var(--surface); }

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
}

.section-heading {
    font-size: 24px;
    font-weight: 600;
}

.section-heading-tamil {
    font-family: var(--font-tamil);
    font-size: 14px;
    color: var(--muted);
    margin-left: 10px;
    font-weight: 400;
}

.view-all-link {
    font-size: 13px;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =============================================
   CATEGORY FILTER PILLS
============================================= */
.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 400;
    border: 0.5px solid var(--border);
    cursor: pointer;
    color: var(--muted);
    background: var(--white);
    transition: all var(--transition);
    text-decoration: none;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--teal-light);
    border-color: var(--teal-mid);
    color: var(--teal-dark);
    font-weight: 500;
}

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

.book-card {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.book-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.book-cover-wrap {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--surface);
    overflow: hidden;
}

.book-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--teal-light);
}

.book-cover-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--teal);
    opacity: 0.5;
}

.book-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .28);
    white-space: nowrap;
}

/*
 * Sale badges show the actual rupee amount saved, not a percentage —
 * "SAVE ₹37" reads as more concrete value than "-5%", especially on
 * higher-priced books where the percentage looks unimpressive.
 * Two tiers by saved amount, not by discount %.
 */
.badge-sale-gold {
    background: linear-gradient(135deg, #E8C766 0%, #C9992E 55%, #B8841E 100%);
    color: #4A2E00;
    box-shadow: 0 2px 8px rgba(184, 132, 30, .4), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.badge-sale-violet {
    background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 60%, #6D28D9 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(109, 40, 217, .4), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* Kept for any code/plugin still referencing the old class name. */
.badge-sale { background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 60%, #6D28D9 100%); color: #fff; }

.badge-new {
    background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal) 55%, var(--teal-dark) 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(15, 110, 86, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.badge-bestseller {
    background: linear-gradient(135deg, #F0A94E 0%, #D97706 55%, #B45309 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(180, 83, 9, .4), inset 0 1px 0 rgba(255, 255, 255, .32);
}

.badge-out {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.book-wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background: white;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition);
}

.book-card:hover .book-wishlist-btn { opacity: 1; }

.book-info {
    padding: 12px 14px 14px;
}

.book-stars {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 5px;
}

.book-stars .star { color: #f59e0b; font-size: 12px; }
.book-stars .review-count { font-size: 11px; color: var(--muted-light); margin-left: 3px; }

.book-title-en {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-title-ta {
    font-family: var(--font-tamil);
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.book-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.book-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.price-current { font-size: 15px; font-weight: 500; color: var(--teal-dark); }
.price-original { font-size: 12px; color: var(--muted-light); text-decoration: line-through; }

.add-to-cart-btn {
    width: 30px;
    height: 30px;
    background: var(--teal);
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

.add-to-cart-btn:hover { background: var(--teal-dark); }

.add-to-cart-btn svg {
    width: 15px;
    height: 15px;
    stroke: white;
    fill: none;
    stroke-width: 2.5;
}

/* =============================================
   SINGLE PRODUCT PAGE
============================================= */
.single-product-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 48px;
    padding: 48px 0;
}

.product-gallery { position: sticky; top: 88px; align-self: start; }

.product-main-image {
    aspect-ratio: 3/4;
    background: var(--teal-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumbs {
    display: flex;
    gap: 8px;
}

.product-thumb {
    width: 64px;
    height: 80px;
    border-radius: var(--radius-sm);
    border: 0.5px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--transition);
}

.product-thumb.active,
.product-thumb:hover { border-color: var(--teal); }

.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-details {}

.product-category-link {
    display: inline-block;
    font-size: 12px;
    color: var(--teal);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.25;
}

.product-title-tamil {
    font-family: var(--font-tamil);
    font-size: 16px;
    color: var(--teal-dark);
    margin-bottom: 14px;
    font-weight: 600;
}

.product-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.product-stars { display: flex; gap: 2px; }
.product-stars .star { color: #f59e0b; font-size: 15px; }

.rating-text { font-size: 13px; color: var(--muted); }

.product-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface);
    border: 0.5px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
}

.meta-chip svg { width: 13px; height: 13px; }

.product-short-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 20px;
    border-left: 2px solid var(--teal-mid);
    padding-left: 14px;
}

.product-price-block {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 24px;
}

.product-price-current { font-size: 30px; font-weight: 500; color: var(--teal-dark); font-family: var(--font-serif); }
.product-price-old { font-size: 18px; color: var(--muted-light); text-decoration: line-through; }
.product-save-badge {
    font-size: 12px;
    background: #dcfce7;
    color: #166534;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 0.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 44px;
    background: var(--surface);
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--muted);
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: var(--teal-light); color: var(--teal-dark); }

.qty-input {
    width: 50px;
    height: 44px;
    border: none;
    border-left: 0.5px solid var(--border);
    border-right: 0.5px solid var(--border);
    text-align: center;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    outline: none;
}

.product-info-list {
    border-top: 0.5px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-info-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.product-info-item svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; color: var(--teal); }
.product-info-item strong { color: var(--ink); font-weight: 500; }

/* Product Tabs */
.product-tabs-section { padding: 40px 0; border-top: 0.5px solid var(--border); }

.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 0.5px solid var(--border);
    margin-bottom: 28px;
}

.tab-btn {
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--teal-dark);
    border-bottom-color: var(--teal);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* =============================================
   BREADCRUMB
============================================= */
.breadcrumb-bar {
    padding: 14px 0;
    border-bottom: 0.5px solid var(--border);
    background: var(--white);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb .sep { color: var(--muted-light); }
.breadcrumb .current { color: var(--ink); }

/* =============================================
   SHOP PAGE
============================================= */
.shop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    padding: 40px 0;
}

.shop-sidebar {}

.sidebar-widget {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.sidebar-widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 0.5px solid var(--border);
}

.sidebar-cat-list { display: flex; flex-direction: column; gap: 4px; }

.sidebar-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.sidebar-cat-item:hover,
.sidebar-cat-item.active {
    background: var(--teal-light);
    color: var(--teal-dark);
}

.sidebar-cat-count {
    font-size: 11px;
    background: var(--surface);
    border-radius: 10px;
    padding: 1px 7px;
    color: var(--muted-light);
}

.price-range-slider { width: 100%; margin: 12px 0; accent-color: var(--teal); }

.shop-main {}

.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 0.5px solid var(--border);
}

.shop-count { font-size: 13px; color: var(--muted); }

.sort-select {
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 7px 12px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    outline: none;
}

/* =============================================
   ABOUT PAGE
============================================= */
.about-hero {
    background: var(--teal-light);
    padding: 64px 0;
    text-align: center;
}

.about-hero h1 { font-size: 36px; margin-bottom: 8px; }
.about-hero .sub { font-family: var(--font-tamil); font-size: 18px; color: var(--teal-dark); }

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 56px 0;
    align-items: center;
}

.about-text h2 { font-size: 26px; margin-bottom: 14px; }
.about-text p { font-size: 15px; color: var(--muted); line-height: 1.8; margin-bottom: 14px; }

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

.value-card {
    background: var(--teal-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.value-icon {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.value-icon svg { width: 18px; height: 18px; stroke: var(--teal); fill: none; stroke-width: 2; }
.value-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.value-card p { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* =============================================
   CONTACT PAGE
============================================= */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
    padding: 56px 0;
}

.contact-info h2 { font-size: 26px; margin-bottom: 8px; }
.contact-sub { font-family: var(--font-tamil); font-size: 14px; color: var(--teal-dark); margin-bottom: 20px; }

.contact-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.contact-icon {
    width: 38px;
    height: 38px;
    background: var(--teal-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon svg { width: 18px; height: 18px; stroke: var(--teal-dark); fill: none; stroke-width: 2; }
.contact-item-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.contact-item-value { font-size: 14px; color: var(--ink); font-weight: 500; }

.contact-form-wrap {
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.contact-form-wrap h3 { font-size: 18px; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 0.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--ink);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition);
}

.form-input:focus,
.form-textarea:focus { border-color: var(--teal-mid); }

.form-textarea { min-height: 110px; resize: vertical; }

/* =============================================
   WOOCOMMERCE OVERRIDES
============================================= */
.woocommerce-message,
.woocommerce-info {
    background: var(--teal-light);
    border-left: 3px solid var(--teal);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--teal-dark);
    margin-bottom: 20px;
}

.woocommerce-error {
    background: #fee2e2;
    border-left: 3px solid #ef4444;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #991b1b;
    margin-bottom: 20px;
}

.woocommerce .price,
.woocommerce-Price-amount {
    color: var(--teal-dark) !important;
    font-weight: 500;
}

.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    background: var(--teal) !important;
    color: white !important;
    font-family: var(--font-sans) !important;
    font-weight: 500 !important;
    border-radius: var(--radius-sm) !important;
    border: none !important;
    padding: 11px 22px !important;
    transition: background var(--transition) !important;
}

.woocommerce .button:hover,
.woocommerce button.button:hover {
    background: var(--teal-dark) !important;
}

.woocommerce table.shop_table {
    border: 0.5px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.woocommerce table.shop_table th {
    background: var(--surface);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    background: var(--teal) !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-sans) !important;
    font-weight: 500 !important;
}

/* =============================================
   FOOTER
============================================= */
.site-footer {
    background: var(--teal-deeper);
    color: rgba(255,255,255,0.85);
    padding: 48px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 0.5px solid rgba(255,255,255,0.1);
}

.footer-brand-col {}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.footer-logo-mark {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-mark svg { width: 18px; height: 18px; stroke: white; fill: none; stroke-width: 2; }

.footer-site-name { font-family: var(--font-serif); font-size: 15px; color: white; }
.footer-site-name-ta { font-family: var(--font-tamil); font-size: 11px; color: rgba(255,255,255,0.5); display: block; }

.footer-desc { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.7; margin-bottom: 18px; }

.footer-social { display: flex; gap: 8px; }

.social-btn {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    transition: background var(--transition);
    font-size: 16px;
}

.social-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.social-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.footer-col-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.footer-links li { margin-bottom: 8px; }
.footer-links a {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    transition: color var(--transition);
}
.footer-links a:hover { color: white; }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

.footer-bottom a { color: rgba(255,255,255,0.45); }
.footer-bottom a:hover { color: white; }

/* =============================================
   PAGINATION
============================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 32px 0;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--muted);
    transition: all var(--transition);
    text-decoration: none;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .shop-layout { grid-template-columns: 200px 1fr; gap: 24px; }
    .single-product-layout { gap: 32px; }
}

@media (max-width: 768px) {
    .header-search { display: none; }

    .main-navigation {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: white;
        border-bottom: 0.5px solid var(--border);
        padding: 12px 24px;
    }

    .main-navigation.open { display: block; }
    .main-navigation ul { flex-direction: column; gap: 2px; }
    .menu-toggle { display: flex; }

    .hero-inner { grid-template-columns: 1fr; }
    .hero-books { display: none; }

    .stats-bar { grid-template-columns: 1fr 1fr; }
    .stat-item { border-right: none; border-bottom: 0.5px solid var(--border); }

    .single-product-layout { grid-template-columns: 1fr; }
    .product-gallery { position: static; }

    .shop-layout { grid-template-columns: 1fr; }
    .shop-sidebar { display: none; }

    .about-content { grid-template-columns: 1fr; }
    .contact-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }

    .books-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-section { padding: 40px 0 36px; }
    .section { padding: 40px 0; }
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}


/* =============================================
   ACCESSIBILITY — skip link & screen reader text
   (Added: keyboard users previously had to tab the entire nav on every page.)
============================================= */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link:focus {
    background: var(--white);
    clip: auto !important;
    clip-path: none;
    color: var(--teal-dark);
    display: block;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    height: auto;
    left: 12px;
    line-height: normal;
    padding: 12px 20px;
    text-decoration: none;
    top: 12px;
    width: auto;
    z-index: 100000;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,.18);
}

/* Visible focus for keyboard users everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
    border-radius: 3px;
}

/* =============================================
   HEADER — scroll state via class, not inline style
============================================= */
.site-header {
    transition: box-shadow .2s ease;
}
.site-header.is-scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, .07);
}

/* =============================================
   BOOK CARD — cover wrap is no longer an <a>
   (a <button> nested inside an <a> is invalid HTML and ate the click)
============================================= */
.book-cover-wrap {
    position: relative;
    display: block;
}
.book-cover-link {
    display: block;
    width: 100%;
    height: 100%;
}
.book-cover-link img {
    display: block;
    width: 100%;
    height: auto;
}

.add-to-cart-btn.is-added {
    background: var(--teal-dark) !important;
}
.add-to-cart-btn:disabled {
    opacity: .75;
    cursor: wait;
}

/* =============================================
   CART FEEDBACK TOAST
   The old JS showed a tick regardless of outcome. Real feedback now.
============================================= */
.tib-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.tib-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    background: var(--teal-deeper, #085041);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.4;
    padding: 12px 20px;
    border-radius: 999px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 9999;
    max-width: calc(100vw - 32px);
    text-align: center;
    pointer-events: none;
}
.tib-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.tib-toast-error {
    background: #991b1b;
}

@media (prefers-reduced-motion: reduce) {
    .tib-toast { transition: opacity .01ms; }
}

/* Spinner */
.tib-spin {
    animation: tib-rotate .7s linear infinite;
}
@keyframes tib-rotate {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .tib-spin { animation: none; }
}

/* =============================================
   PRICE FILTER FORM
============================================= */
#price-filter-form .price-range-slider {
    width: 100%;
    accent-color: var(--teal);
}

/* =============================================
   REVIEWS
============================================= */
.comments-area {
    max-width: 720px;
}
.review-avatar {
    border-radius: 50%;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-form .form-input,
.comment-form .form-textarea {
    width: 100%;
}
.comment-form .submit {
    margin-top: 8px;
}

/* =============================================
   WOOCOMMERCE NOTICES — were never rendered before
============================================= */
.woocommerce-notices-wrapper:empty {
    display: none;
}
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 0 0 20px;
    list-style: none;
}
.woocommerce-message {
    background: var(--teal-light);
    color: var(--teal-deeper);
    border: 0.5px solid var(--teal-mid);
}
.woocommerce-info {
    background: #eff6ff;
    color: #1e40af;
    border: 0.5px solid #bfdbfe;
}
.woocommerce-error {
    background: #fee2e2;
    color: #991b1b;
    border: 0.5px solid #fecaca;
}
.woocommerce-message .button,
.woocommerce-error .button {
    float: right;
    font-size: 13px;
    color: inherit;
    text-decoration: underline;
}

/* =============================================
   TERM DESCRIPTION (SEO copy on category pages)
============================================= */
.term-description p:last-child { margin-bottom: 0; }

/* =============================================
   PRINT — customers print invoices and book lists
============================================= */
@media print {
    .site-header,
    .site-footer,
    .breadcrumb-bar,
    .add-to-cart-btn,
    .product-actions,
    .tib-toast {
        display: none !important;
    }
    body { background: #fff; }
}

/* =============================================
   PUBLISHERS / BRANDS
============================================= */
.publisher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.publisher-grid-full {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.publisher-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 20px 16px;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.publisher-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15, 110, 86, .10);
    border-color: var(--teal-mid);
}

.publisher-logo-box {
    width: 100%;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.publisher-logo {
    max-width: 100%;
    max-height: 84px;
    width: auto;
    height: auto;
    object-fit: contain;
}
/* Name-plate fallback when a publisher has no logo yet. */
.publisher-initial {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-light) 0%, #d6efe6 100%);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
}
.publisher-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.35;
}
.publisher-count {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
}

/* =============================================
   STANDALONE LANDING PAGES (All Categories / Publishers)
============================================= */
.landing-page {
    padding: 32px 0 56px;
}
.landing-header {
    margin-bottom: 28px;
}
.landing-title {
    font-family: var(--font-serif);
    font-size: 30px;
    color: var(--ink);
    margin: 0 0 6px;
    line-height: 1.2;
}
.landing-title-tamil {
    display: block;
    font-size: 16px;
    color: var(--teal-dark);
    font-weight: 400;
    margin-top: 4px;
}
.landing-intro {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
    max-width: 680px;
}

/* Full category grid — richer than the 6-tile homepage strip */
.category-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.cat-card-full {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 110, 86, .10);
    border-color: var(--teal-mid);
}
.cat-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--teal-light);
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cat-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-card-body { flex: 1; min-width: 0; }
.cat-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.cat-card-count {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.cat-card-arrow {
    flex-shrink: 0;
    color: var(--muted-light, #b8c2bd);
    transition: color .18s ease, transform .18s ease;
}
.cat-card-full:hover .cat-card-arrow {
    color: var(--teal);
    transform: translateX(3px);
}

@media (max-width: 640px) {
    .publisher-grid,
    .publisher-grid-full {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-grid-full {
        grid-template-columns: 1fr;
    }
    .landing-title { font-size: 24px; }
}
