/* -----------------------------------------------------------
   KISO TRADING - WOOCOMMERCE STYLES
   Handles: Shop Grid, Single Product, Cart, Checkout, Mini Cart
----------------------------------------------------------- */

/* Variables (Inherited from root, re-declared for reference if needed, but usually redundant if loaded after main.css) */
:root {
    --color-primary: #0f172a;
    --color-accent: #f59e0b;
    --border-radius: 8px;
    --border-radius-lg: 16px;
}

/* -----------------------------------------------------------
   1. SHOP GRID & ARCHIVES
----------------------------------------------------------- */
.woocommerce .container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 20px; }

.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 30px;
}

/* Sidebar Widgets */
.shop-layout aside.widget-area .widget { margin-bottom: 30px; }
.shop-layout aside.widget-area .widget-title { font-size: 1.1rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; margin-bottom: 15px; }

/* Product Grid */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    padding: 0 !important;
    margin: 0 !important;
}

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

li.product {
    width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--border-radius) !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
}

li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
    border-color: var(--color-accent) !important;
}

/* Product Image */
li.product a.woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

li.product img {
    width: 100% !important;
    height: 200px !important;
    object-fit: contain !important;
    margin-bottom: 15px !important;
}

/* Titles & Prices */
li.product .woocommerce-loop-product__title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--color-primary) !important;
    line-height: 1.4 !important;
    margin-bottom: 10px !important;
    min-height: 2.8em;
}

li.product .price {
    font-size: 1.1rem !important;
    color: var(--color-accent) !important;
    font-weight: 800 !important;
    margin-bottom: 15px !important;
    display: block !important;
}

/* Buttons in Loop */
li.product .button {
    margin-top: auto !important;
    width: 100% !important;
    background: linear-gradient(135deg, var(--color-accent) 0%, #fbbf24 100%);
    color: #0f172a;
    font-weight: 700;
    text-align: center;
    padding: 12px;
}

/* Responsive Grid */
@media (max-width: 1200px) { ul.products { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 992px) { 
    .shop-layout { grid-template-columns: 1fr; } 
    #secondary { display: none; } /* Hide Sidebar on Mobile */
    ul.products { grid-template-columns: repeat(2, 1fr) !important; } 
}
@media (max-width: 576px) { ul.products { grid-template-columns: 1fr !important; } }


/* -----------------------------------------------------------
   2. SINGLE PRODUCT PAGE
   Fixes layout issues by using Flexbox for the main container
----------------------------------------------------------- */
.single-product div.product {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    margin-top: 30px;
}

/* Gallery (Left) */
.single-product div.product .woocommerce-product-gallery {
    width: 48%; /* Flex Item width */
    flex: 0 0 48%;
    position: relative;
}

.woocommerce-product-gallery img {
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
}

.woocommerce-product-gallery .flex-control-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding: 0;
    list-style: none;
}
.woocommerce-product-gallery .flex-control-thumbs li { width: 20%; cursor: pointer; }

/* Summary (Right) */
.single-product div.product .summary {
    width: 48%; /* Flex Item width */
    flex: 0 0 48%;
    display: flex;
    flex-direction: column;
}

.single-product .product_title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.single-product .price {
    font-size: 1.8rem;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 20px;
}

.single-product .woocommerce-product-details__short-description {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 30px;
}

/* Add to Cart Form */
.single-product form.cart {
    display: flex;
    gap: 15px;
    padding: 25px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    margin-bottom: 30px;
    align-items: center;
}

.single-product .quantity input {
    height: 50px;
    width: 70px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 700;
}

.single-product button.single_add_to_cart_button {
    flex: 1;
    height: 50px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tabs */
.woocommerce-tabs {
    width: 100%; /* Full width below gallery/summary */
    margin-top: 60px;
    border-top: 1px solid #e2e8f0;
    padding-top: 40px;
}

.woocommerce-tabs ul.tabs {
    display: flex;
    gap: 30px;
    padding: 0;
    margin: 0 0 30px 0;
    list-style: none;
    border-bottom: 2px solid #f1f5f9;
}

.woocommerce-tabs ul.tabs li a {
    font-weight: 700;
    font-size: 1.1rem;
    color: #94a3b8;
    padding-bottom: 10px;
    display: block;
    text-decoration: none;
}

.woocommerce-tabs ul.tabs li.active a {
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-accent);
}

/* Responsive Single Product */
@media (max-width: 992px) {
    .single-product div.product { flex-direction: column; }
    .single-product div.product .woocommerce-product-gallery,
    .single-product div.product .summary { width: 100%; flex: 0 0 100%; }
}

/* -----------------------------------------------------------
   3. MINI CART DROPDOWN
----------------------------------------------------------- */
.kiso-mini-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: white;
    border-top: 4px solid var(--color-accent);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

.cart-dropdown-wrapper:hover .kiso-mini-cart-dropdown, 
.cart-dropdown-wrapper:focus-within .kiso-mini-cart-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mini-cart-list { list-style: none; padding: 0; margin: 0; max-height: 350px; overflow-y: auto; }
.mini-cart-item { display: flex; gap: 15px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f1f5f9; position: relative; }
.mini-cart-item img { width: 60px; height: 60px; border-radius: 4px; object-fit: cover; }
.mini-cart-item .item-details { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.mini-cart-item .item-name { font-weight: 700; font-size: 0.95rem; line-height: 1.3; color: var(--color-primary); text-decoration: none; }
.mini-cart-item .item-price { font-size: 0.9rem; color: #64748b; margin-top: 4px; }
.mini-cart-item .remove-item { position: absolute; top: 0; right: 0; color: #ef4444; font-size: 1.2rem; text-decoration: none; }

.mini-cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 800; color: var(--color-primary); margin-bottom: 20px; padding-top: 10px; }
.mini-cart-buttons { display: flex; gap: 10px; }
.mini-cart-buttons .button { flex: 1; text-align: center; }

/* -----------------------------------------------------------
   4. B2B & NOTICES
----------------------------------------------------------- */
.kiso-price-label { font-size: 0.8rem; color: #94a3b8; display: block; margin-bottom: 2px; }
.kiso-price-label.b2b { color: #16a34a; font-weight: 700; }

.kiso-b2b-notice { background: #eff6ff; border: 1px solid #bfdbfe; padding: 20px; border-radius: 8px; margin: 20px 0; display: flex; gap: 15px; }
.notice-icon { color: #2563eb; }
