/*
Theme Name: Blocksy Child - Gopinath Books
Theme URI: https://gopinathbooks.com/
Description: Amazon & Flipkart Modern E-Commerce Bookstore Child Theme for Gopinath Books (Blocksy + WooCommerce + Elementor).
Author: Gopinath Books
Author URI: https://gopinathbooks.com/
Template: blocksy
Version: 1.0.2
Text Domain: blocksy-child
*/

/* ==========================================================================
   1. GLOBAL RESET & MOBILE OVERFLOW CONTAINMENT
   ========================================================================== */
:root {
    --fk-blue: #2874F0;
    --fk-yellow: #FFE500;
    --fk-orange: #FB641B;
    --amz-yellow: #FFA41C;
    --amz-yellow-hover: #FA8900;
    --amz-dark: #131921;
    --amz-orange: #FF6161;
    --text-primary: #212121;
    --text-secondary: #717478;
    --border-light: #E0E0E0;
    --bg-light: #F1F3F6;
    --success-green: #388E3C;
}

*, *::before, *::after {
    box-sizing: border-box !important;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

#main-container, .site-main, .entry-content, .woocommerce, .ct-container, .product, .woocommerce-page {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Eliminate awkward monospace font from titles, headings, and reviews */
h1, h2, h3, h4, h5, h6, 
.entry-title, .product-title, .woocommerce-loop-product__title, 
.comment-text, .woocommerce-Tabs-panel, .ct-breadcrumbs {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   2. HEADER & MOBILE MENU FIXES
   ========================================================================== */
.site-header, .ct-header {
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    z-index: 1000;
    width: 100% !important;
    max-width: 100vw !important;
}

.site-branding, .custom-logo-link {
    margin-right: 20px !important;
    display: inline-flex !important;
    align-items: center;
}

.site-branding img, .custom-logo-link img {
    max-height: 48px !important;
    width: auto !important;
}

/* Mobile Offcanvas Drawer Links & Background (Fix Invisible White Links) */
.ct-panel-content,
.ct-drawer-canvas,
.ct-offcanvas-menu,
[data-drawer] {
    background: #ffffff !important;
    max-width: 85vw !important;
}

.ct-mobile-menu a,
.ct-panel-content a,
.ct-offcanvas-menu a,
.mobile-menu a {
    color: #111111 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    display: block !important;
    text-decoration: none !important;
}

.ct-mobile-menu a:hover,
.ct-panel-content a:hover {
    color: var(--fk-blue) !important;
    background: #f7f9fa !important;
}

/* ==========================================================================
   3. CATALOG & PRODUCT CARDS (DESKTOP & MOBILE 2-COLUMN GRID)
   ========================================================================== */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: 18px !important;
    padding: 0 !important;
    margin: 20px 0 !important;
    width: 100% !important;
    list-style: none !important;
}

ul.products::before, ul.products::after {
    display: none !important;
}

ul.products li.product {
    background: #ffffff !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 6px !important;
    padding: 14px !important;
    margin: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease !important;
    box-sizing: border-box !important;
}

ul.products li.product:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px);
}

/* Uniform Book Cover (3:4 ratio) */
ul.products li.product a img,
.ct-media-container img {
    width: 100% !important;
    height: 230px !important;
    object-fit: contain !important;
    margin-bottom: 10px !important;
    background: #fafafa;
    border-radius: 4px;
    padding: 6px;
    display: block;
}

ul.products li.product .woocommerce-loop-product__title {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: var(--text-primary) !important;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 6px 0 !important;
}

/* Card Price Display */
ul.products li.product .price {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin: 4px 0 10px 0 !important;
    display: flex !important;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

ul.products li.product .price del {
    font-size: 12.5px !important;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
}

ul.products li.product .price ins {
    text-decoration: none !important;
    color: var(--text-primary) !important;
}

ul.products li.product .button {
    background: #f0f2f2 !important;
    border: 1px solid #d5d9d9 !important;
    color: #0f1111 !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 8px 12px !important;
    box-shadow: 0 2px 4px rgba(213,217,217,.4) !important;
    transition: background 0.2s ease !important;
}

ul.products li.product .button:hover {
    background: #e3e6e6 !important;
}

/* Mobile 2-Column Catalog Grid (Amazon / Flipkart Bookstore Layout) */
@media (max-width: 767px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin: 12px 0 !important;
    }

    ul.products li.product {
        padding: 10px !important;
        border-radius: 6px !important;
    }

    ul.products li.product a img,
    .ct-media-container img {
        height: 155px !important;
        padding: 4px !important;
        margin-bottom: 6px !important;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 13px !important;
        height: 36px !important;
        line-height: 1.35 !important;
        margin: 4px 0 !important;
    }

    ul.products li.product .price {
        font-size: 14px !important;
        margin: 2px 0 8px 0 !important;
    }

    ul.products li.product .button {
        font-size: 12px !important;
        padding: 6px 8px !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   4. SINGLE PRODUCT PAGE LAYOUT & GALLERY
   ========================================================================== */
@media (min-width: 992px) {
    .woocommerce #content div.product,
    .woocommerce div.product {
        display: grid !important;
        grid-template-columns: 42% 58% !important;
        gap: 36px !important;
        align-items: start !important;
    }

    .woocommerce div.product div.images {
        width: 100% !important;
        float: none !important;
        margin-bottom: 0 !important;
        position: sticky;
        top: 24px;
    }

    .woocommerce div.product div.images img {
        max-height: 520px !important;
        width: auto !important;
        margin: 0 auto !important;
        display: block !important;
        object-fit: contain !important;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 12px;
        background: #fff;
    }

    .woocommerce div.product div.summary {
        width: 100% !important;
        float: none !important;
        padding-left: 8px;
    }
}

/* Product gallery & thumbnail blowout fix for mobile */
.woocommerce div.product div.images,
.woocommerce-product-gallery,
.woocommerce-product-gallery__wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.woocommerce div.product div.images img {
    max-width: 100% !important;
    height: auto !important;
}

.woocommerce div.product div.images .flex-control-thumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 12px 0 0 0 !important;
    list-style: none !important;
    max-width: 100% !important;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    width: calc(25% - 6px) !important;
    max-width: 80px !important;
    float: none !important;
    margin: 0 !important;
    flex: 0 0 calc(25% - 6px) !important;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    width: 100% !important;
    height: auto !important;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px;
}

.woocommerce div.product .product_title {
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: var(--text-primary) !important;
    margin-bottom: 8px !important;
}

/* ==========================================================================
   5. ACTION BUTTONS (AMAZON ADD TO CART + FLIPKART BUY NOW)
   ========================================================================== */
.woocommerce div.product form.cart,
.ct-cart-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin: 20px 0 !important;
    align-items: center !important;
}

.woocommerce div.product form.cart .quantity,
.ct-cart-actions .quantity {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 6px !important;
}

.woocommerce div.product form.cart .quantity input.qty,
.ct-cart-actions .quantity input.qty {
    height: 48px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* Amazon Yellow "Add to Cart" */
.woocommerce div.product form.cart button.single_add_to_cart_button,
.woocommerce div.product form.cart .single_add_to_cart_button,
button.single_add_to_cart_button.button {
    background: var(--amz-yellow) !important;
    border: 1px solid #FCD200 !important;
    color: #0F1111 !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    height: 48px !important;
    line-height: 48px !important;
    padding: 0 28px !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(213,217,217,.5) !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    text-transform: none !important;
}

.woocommerce div.product form.cart button.single_add_to_cart_button:hover,
button.single_add_to_cart_button.button:hover {
    background: var(--amz-yellow-hover) !important;
    color: #0F1111 !important;
    border-color: #FA8900 !important;
    transform: translateY(-1px);
}

/* Flipkart Orange "Buy Now" */
.woocommerce div.product form.cart .button.gopinath-buy-now-btn,
.button.gopinath-buy-now-btn {
    background: var(--fk-orange) !important;
    border: 1px solid #e0540d !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    height: 48px !important;
    line-height: 48px !important;
    padding: 0 28px !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    box-shadow: 0 2px 6px rgba(251, 100, 27, 0.4) !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
}

.woocommerce div.product form.cart .button.gopinath-buy-now-btn:hover,
.button.gopinath-buy-now-btn:hover {
    background: #e0540d !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Single Product Full-Width Mobile Stacking (Prevents Offscreen Overflow) */
@media (max-width: 767px) {
    .woocommerce div.product form.cart,
    .ct-cart-actions {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 10px !important;
        margin: 16px 0 !important;
    }

    .woocommerce div.product form.cart .quantity,
    .ct-cart-actions .quantity {
        width: 100% !important;
        margin: 0 0 6px 0 !important;
        display: flex !important;
        justify-content: center !important;
    }

    .woocommerce div.product form.cart .quantity input.qty,
    .ct-cart-actions .quantity input.qty {
        width: 80px !important;
        height: 44px !important;
    }

    .woocommerce div.product form.cart button.single_add_to_cart_button,
    .woocommerce div.product form.cart .button.gopinath-buy-now-btn,
    button.single_add_to_cart_button.button,
    .button.gopinath-buy-now-btn {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 48px !important;
        line-height: 48px !important;
        font-size: 16px !important;
        border-radius: 24px !important;
        margin: 0 !important;
        justify-content: center !important;
    }
}

/* ==========================================================================
   6. PRICE & SAVINGS FORMATTING
   ========================================================================== */
.gopinath-price-block {
    background: #fafafa;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0;
    max-width: 100%;
}

.gopinath-sale-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gopinath-discount-pill {
    background: #CC0C39;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.gopinath-final-price {
    font-size: 26px;
    font-weight: 700;
    color: #0F1111;
}

.gopinath-mrp-row {
    font-size: 13px;
    color: #565959;
    margin-top: 4px;
}

.gopinath-savings-badge {
    color: var(--success-green);
    font-size: 13.5px;
    font-weight: 600;
    margin-top: 4px;
}

/* ==========================================================================
   7. BOOK SPECIFICATIONS TABLE
   ========================================================================== */
.gopinath-book-specs-box {
    margin: 20px 0;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.gopinath-book-specs-box .specs-heading {
    background: #f8f9fa;
    margin: 0;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
}

.gopinath-book-specs-box .specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: #fff;
}

@media (max-width: 600px) {
    .gopinath-book-specs-box .specs-grid {
        grid-template-columns: 1fr;
    }
}

.spec-row {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    font-size: 13.5px;
}

.spec-label {
    width: 40%;
    color: var(--text-secondary);
    font-weight: 500;
}

.spec-value {
    width: 60%;
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   8. PINCODE CHECKER & TRUST BADGES
   ========================================================================== */
.gopinath-buybox-perks {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    max-width: 100%;
}

.pincode-title {
    font-size: 13px;
    font-weight: 600;
    color: #212121;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.pincode-input-group {
    display: flex;
    max-width: 320px;
    width: 100%;
}

.pincode-input-group input {
    flex: 1;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 8px 12px;
    font-size: 13px;
    width: 100%;
}

.pincode-input-group button {
    background: var(--fk-blue);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.pincode-result {
    margin-top: 8px;
    font-size: 13px;
}

.trust-guarantee-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-light);
}

@media (max-width: 600px) {
    .trust-guarantee-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trust-icon {
    font-size: 18px;
}

.trust-text {
    font-size: 12.5px;
    color: #444;
    font-weight: 500;
    line-height: 1.25;
}

/* ==========================================================================
   9. COMPACT TOOLBAR CATEGORY FILTER & SORTING
   ========================================================================== */
.gopinath-toolbar-category-filter {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 8px !important;
    margin-bottom: 0 !important;
}

.gopinath-toolbar-category-filter select,
#gopinath-inline-cat-select {
    height: 40px !important;
    border: 1px solid #d5d9d9 !important;
    border-radius: 6px !important;
    padding: 0 32px 0 12px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #0f1111 !important;
    background: #f0f2f2 !important;
    cursor: pointer !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

.gopinath-toolbar-category-filter select:hover,
#gopinath-inline-cat-select:hover {
    background: #e3e6e6 !important;
    border-color: #a6acac !important;
}

/* Mobile responsive toolbar */
@media (max-width: 767px) {
    .ct-woocommerce-archive-top,
    .woocommerce-before-shop-loop {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .gopinath-toolbar-category-filter {
        width: 100% !important;
        margin-right: 0 !important;
    }

    .gopinath-toolbar-category-filter select,
    #gopinath-inline-cat-select {
        width: 100% !important;
    }

    .woocommerce-ordering {
        width: 100% !important;
    }

    .woocommerce-ordering select.orderby {
        width: 100% !important;
        height: 40px !important;
    }
}
