/**
 * TheBookNova - WooCommerce Dedicated Stylesheet
 */

/* Brand Logo Constraints for WooCommerce Templates */
.tbn-brand-logo-img,
.custom-logo,
.tbn-logo-wrap img,
.tbn-logo-link img,
.site-header .custom-logo,
.tbn-footer-col .custom-logo,
.tbn-footer-col .tbn-brand-logo-img,
.tbn-footer-col .tbn-logo-link img {
    height: 46px !important;
    max-height: 46px !important;
    max-width: 220px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
}

/* WooCommerce Messages & Alerts */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
    border-radius: var(--tbn-radius-md);
    padding: 14px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.woocommerce-message {
    background: #ecfdf5;
    border: 1.5px solid #a7f3d0;
    color: #065f46;
}

.woocommerce-info {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    color: #1e40af;
}

.woocommerce-error {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    color: #991b1b;
    list-style: none;
}

.woocommerce-message a.button, .woocommerce-info a.button {
    background: var(--tbn-primary);
    color: #fff;
    border-radius: var(--tbn-radius-full);
    padding: 6px 16px;
    font-size: 13px;
    margin-left: auto;
}

/* Shop Catalog Layout */
.tbn-shop-archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 35px;
    padding: 35px 0 60px;
}

.tbn-shop-sidebar {
    background: #fff;
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-lg);
    padding: 24px;
    box-shadow: var(--tbn-shadow-sm);
    height: fit-content;
}

.tbn-filter-widget {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tbn-border);
}

.tbn-filter-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tbn-filter-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--tbn-dark);
    margin-bottom: 14px;
}

.tbn-cat-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tbn-cat-filter-list li {
    margin-bottom: 8px;
}

.tbn-cat-filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--tbn-text);
    padding: 4px 0;
}

.tbn-cat-filter-list a:hover {
    color: var(--tbn-secondary);
}

.tbn-cat-count {
    background: var(--tbn-light-bg);
    padding: 2px 8px;
    border-radius: var(--tbn-radius-full);
    font-size: 11px;
    color: var(--tbn-text-muted);
}

/* Shop Top Bar (Sorting & Counter) */
.tbn-shop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-md);
    padding: 14px 20px;
    margin-bottom: 25px;
}

.woocommerce-result-count {
    font-size: 14px;
    color: var(--tbn-text-muted);
    margin: 0;
}

.woocommerce-ordering select {
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
}

/* Single Product Presentation */
.tbn-single-product-container {
    padding: 35px 0 60px;
}

.tbn-product-gallery-box {
    max-width: 440px !important;
    margin: 0 auto !important;
    width: 100% !important;
}

.tbn-main-book-cover {
    background: #fff !important;
    border: 1px solid var(--tbn-border) !important;
    border-radius: var(--tbn-radius-lg) !important;
    padding: 25px !important;
    text-align: center !important;
    box-shadow: var(--tbn-shadow-md) !important;
    margin-bottom: 15px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 400px !important;
    max-width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.tbn-main-book-cover img,
.tbn-single-cover-img,
.single-product .wp-post-image {
    max-height: 380px !important;
    max-width: 260px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
    box-shadow: 5px 8px 20px rgba(0, 71, 51, 0.18) !important;
    display: block !important;
}

/* Single Product Tabs */
.tbn-custom-product-tabs {
    background: #fff;
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-lg);
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: var(--tbn-shadow-sm);
}

.tbn-tab-nav {
    display: flex;
    gap: 15px;
    border-bottom: 2px solid var(--tbn-border);
    margin-bottom: 25px;
    padding-bottom: 12px;
}

.tbn-tab-link {
    font-size: 16px;
    font-weight: 700;
    color: var(--tbn-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--tbn-radius-sm);
    transition: all 0.2s ease;
}

.tbn-tab-link.active, .tbn-tab-link:hover {
    color: var(--tbn-primary);
    background: var(--tbn-primary-light);
}

.tbn-tab-panel {
    display: none;
    animation: tbnFadeIn 0.25s ease;
    line-height: 1.7;
}

.tbn-tab-panel.active {
    display: block;
}

/* Cart Page */
.tbn-cart-page-grid {
    display: grid;
    grid-template-columns: 1.6fr 0.9fr;
    gap: 40px;
    padding: 35px 0 60px;
}

.shop_table.cart {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-lg);
    overflow: hidden;
    box-shadow: var(--tbn-shadow-sm);
}

.shop_table.cart th {
    background: #f8fafc;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    color: var(--tbn-dark);
    border-bottom: 1px solid var(--tbn-border);
}

.shop_table.cart td {
    padding: 18px;
    border-bottom: 1px solid var(--tbn-border);
    vertical-align: middle;
}

.tbn-cart-collaterals {
    background: #fff;
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-lg);
    padding: 24px;
    box-shadow: var(--tbn-shadow-sm);
}

.cart_totals h2 {
    font-size: 20px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tbn-border);
}

.checkout-button {
    width: 100%;
    background: var(--tbn-secondary) !important;
    color: #fff !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    border-radius: var(--tbn-radius-full) !important;
    text-align: center;
    display: block;
    box-shadow: 0 4px 15px rgba(255, 91, 20, 0.35);
    transition: all 0.2s ease !important;
}

.checkout-button:hover {
    background: var(--tbn-secondary-dark) !important;
    transform: translateY(-2px);
}

/* Checkout Page Grid */
.tbn-checkout-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    padding: 35px 0 60px;
}

.tbn-checkout-billing-box, .tbn-checkout-order-box {
    background: #fff;
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-lg);
    padding: 30px;
    box-shadow: var(--tbn-shadow-sm);
}

.tbn-checkout-box-title {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tbn-border);
    color: var(--tbn-dark);
}

.woocommerce-billing-fields__field-wrapper p {
    margin-bottom: 14px;
}

.woocommerce-billing-fields__field-wrapper input,
.woocommerce-billing-fields__field-wrapper select {
    width: 100%;
    border: 1px solid var(--tbn-border);
    border-radius: var(--tbn-radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}

.woocommerce-billing-fields__field-wrapper input:focus {
    border-color: var(--tbn-primary);
    box-shadow: 0 0 0 3px rgba(0, 71, 51, 0.1);
}

#place_order {
    background: var(--tbn-secondary) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    padding: 14px 24px !important;
    border-radius: var(--tbn-radius-full) !important;
    width: 100%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 91, 20, 0.4);
}

#place_order:hover {
    background: var(--tbn-secondary-dark) !important;
}

@media (max-width: 900px) {
    .tbn-shop-archive-layout {
        grid-template-columns: 1fr;
    }
    .tbn-cart-page-grid {
        grid-template-columns: 1fr;
    }
    .tbn-checkout-grid {
        grid-template-columns: 1fr;
    }
}
