/* ==========================================================================
   Phase 1: Full-Width List Layout (Product Loop)
   ========================================================================== */

/* Override default WooCommerce columns and layout */
.woocommerce ul.products {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
    transition: box-shadow 0.3s ease;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* 1. Left Column: Thumbnail (25%) */
.product-list-col-left {
    flex: 0 0 25%;
    max-width: 25%;
    padding-right: 1.5rem;
}

.product-list-col-left img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* 2. Middle Column: Title, SKU, Short Description (55%) */
.product-list-col-mid {
    flex: 0 0 55%;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 1.5rem;
    border-right: 1px solid #eaeaea;
}

.product-list-col-mid .woocommerce-loop-product__title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    color: #333;
    font-weight: 600;
}

.product-list-sku {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.product-list-desc-accordion summary {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    outline: none;
    user-select: none;
    margin-bottom: 0.5rem;
}

.product-list-desc-accordion p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* 3. Right Column: Price & Quick View (20%) */
.product-list-col-right {
    flex: 0 0 20%;
    max-width: 20%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-left: 1.5rem;
    text-align: center;
}

.product-list-col-right .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 1rem;
    display: block;
}

.btn-quick-view {
    background: #000;
    color: #fff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
    width: 100%;
}

.btn-quick-view:hover {
    background: #333;
}

/* Responsive Stacking */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        flex-direction: column;
    }
    
    .product-list-col-left,
    .product-list-col-mid,
    .product-list-col-right {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 0;
        border: none;
    }
    
    .product-list-col-left {
        margin-bottom: 1rem;
    }
    
    .product-list-col-mid {
        margin-bottom: 1.5rem;
    }
    
    .product-list-col-right {
        border-top: 1px solid #eaeaea;
        padding-top: 1.5rem;
    }
}

/* ==========================================================================
   Phase 2: Ajax-Powered Bottom Sheet (Quick View)
   ========================================================================== */

/* Overlay */
.quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
    backdrop-filter: blur(4px);
}

.quick-view-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Bottom Sheet Container */
.quick-view-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 24px 24px 0 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
}

.quick-view-sheet.is-open {
    transform: translateY(0);
}

/* Sheet Header (Drag handle & Close) */
.quick-view-header {
    display: flex;
    justify-content: center;
    padding: 1rem;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.sheet-drag-handle {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
}

.btn-close-sheet {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.2s;
}

.btn-close-sheet:hover {
    background: #e0e0e0;
}

/* Sheet Body */
.quick-view-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Loading State */
.quick-view-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: #888;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loaded Content Styles */
.qv-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 769px) {
    .qv-content-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .qv-gallery {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .qv-details {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 1.5rem;
    }
}

.qv-gallery .swiper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.qv-gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.qv-title {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.qv-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.qv-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1.5rem;
}

.qv-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #000;
}

/* Add to cart form within Quick View */
.qv-details form.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.qv-details form.cart .quantity input {
    width: 60px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.qv-details form.cart button.button {
    flex: 1;
    background: #000;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.qv-details form.cart button.button:hover {
    background: #333;
}
