/**
 * WooCommerce Shop & Product UI Manager - Shop Layout
 * Amazon/Flipkart-style professional e-commerce design
 * Scoped to .wc-shop-ui-manager-wrap to avoid theme conflicts
 * Minimal !important - only where theme overrides would break layout
 */

/* ==========================================================================
   Breadcrumb - Full page width (yellow bar edge-to-edge)
   ========================================================================== */

/* Elementor widget + section - force full viewport width */
.woocommerce-page .elementor-widget-woocommerce-breadcrumb,
body.woocommerce .elementor-widget-woocommerce-breadcrumb {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-sizing: border-box;
}

/* Elementor section + container - full width */
.woocommerce-page .elementor-widget-woocommerce-breadcrumb .elementor-widget-wrap,
.woocommerce-page .elementor-widget-woocommerce-breadcrumb .elementor-widget-container,
.woocommerce-page .elementor-widget-woocommerce-breadcrumb .elementor-container,
.woocommerce-page .woocommerce-breadcrumb-wrap,
.woocommerce-page .page-header {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 22px 24px;
    box-sizing: border-box;
}

/* Breadcrumb text itself */
.woocommerce-page .woocommerce-breadcrumb,
.woocommerce .woocommerce-breadcrumb,
.elementor-widget-woocommerce-breadcrumb .woocommerce-breadcrumb {
    width: 100%;
    max-width: 100%;
    padding: 22px 24px;
    box-sizing: border-box;
}

/* Parent section - break out of theme/Elementor container (full width) */
body.woocommerce .elementor-section:has(.elementor-widget-woocommerce-breadcrumb),
body.woocommerce .elementor-section:has(.woocommerce-breadcrumb) {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* Elementor container + column - full width */
body.woocommerce .elementor-section:has(.elementor-widget-woocommerce-breadcrumb) .elementor-container,
body.woocommerce .elementor-section:has(.elementor-widget-woocommerce-breadcrumb) .elementor-column {
    max-width: 100vw !important;
    width: 100% !important;
}

/* ==========================================================================
   Grid Layout - Responsive
   Desktop: 4 columns | Tablet: 3 columns | Mobile: 2 columns
   ========================================================================== */

.wc-shop-ui-manager-wrap .woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
    gap: 20px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .wc-shop-ui-manager-wrap .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px 20px;
    }
    .wc-shop-ui-manager-wrap .woocommerce ul.products li.product {
        min-height: 360px;
    }
}

@media (max-width: 600px) {
    .wc-shop-ui-manager-wrap .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 16px;
    }
    .wc-shop-ui-manager-wrap .woocommerce ul.products li.product {
        min-height: 340px;
    }
}

/* ==========================================================================
   Product Card - Clean white card with soft shadow
   ========================================================================== */

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: 380px;
    align-self: stretch;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Product Image Container - Square aspect ratio
   Products with missing images: placeholder visible, never hidden
   ========================================================================== */

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-shop-ui-card {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .woocommerce-loop-product__link,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product > a:first-of-type {
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 140px;
    position: relative;
    line-height: 0;
    background: #f8f9fa;
    padding: 16px;
    box-sizing: border-box;
    flex-shrink: 0;
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product a.woocommerce-LoopProduct-link:hover,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .woocommerce-loop-product__link:hover,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product > a:first-of-type:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

/* Placeholder for missing images - ensures product is never hidden */
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-placeholder,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .woocommerce-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #9ca3af;
    font-size: 14px;
    border-radius: 10px;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product img,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    display: block;
    border-radius: 10px;
    image-rendering: auto;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product a:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   Product Title - Max 2 lines, links to single product
   ========================================================================== */

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .woocommerce-loop-product__title,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product h2,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .woocommerce-loop-category__title {
    display: block;
    visibility: visible;
    padding: 6px 14px 4px;
    color: #007185;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
    text-align: center;
    flex-shrink: 0;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .woocommerce-loop-product__link {
    color: inherit;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product a.woocommerce-LoopProduct-link:hover,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .woocommerce-loop-product__link:hover {
    color: #c7511f;
}

/* ==========================================================================
   Price & Actions
   ========================================================================== */

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .price {
    display: block;
    padding: 6px 14px 2px;
    color: #0F1111;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .price .amount,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .price bdi {
    font-weight: 600;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .star-rating {
    margin: 0 14px 6px;
}

/* ==========================================================================
   Add to Cart Button - Centered, green text on hover
   ========================================================================== */

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-shop-ui-card-actions {
    text-align: center;
    padding: 8px 14px 14px;
    margin-top: auto;
}

/* Quantity input (+/-) - spacing from price, not stuck to top */
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-loop-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 12px;
    margin-top: 4px;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Quantity number display - visible span (theme can't hide it) */
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .qty-display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #0F1111;
    background: #ffffff;
    box-sizing: border-box;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .plus,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .minus {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .plus:hover,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .minus:hover {
    background: #e5e7eb;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .plus.disabled,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .plus:disabled,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .minus.disabled,
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .wc-ui-manager-quantity .minus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .button {
    display: block;
    width: calc(100% - 28px);
    margin: 0 auto 8px;
    padding: 10px 14px;
    text-align: center;
    background: #FFD814;
    color: #0F1111;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .button:hover {
    opacity: 0.92;
    background: #f7ca00;
    color: #16a34a;
}

/* Sale badge */
.wc-shop-ui-manager-wrap .woocommerce ul.products li.product .onsale {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: #B12704;
    color: #fff;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

/* ==========================================================================
   Shop Page Header
   ========================================================================== */

.wc-shop-ui-manager-wrap .woocommerce-page .page-title {
    font-size: 22px;
    font-weight: 700;
    color: #0F1111;
    margin-bottom: 12px;
}

.wc-shop-ui-manager-wrap .woocommerce-result-count,
.wc-shop-ui-manager-wrap .woocommerce-ordering {
    color: #565959;
    font-size: 13px;
}

/* ==========================================================================
   Sticky Floating Cart Button
   ========================================================================== */

.wc-shop-ui-sticky-cart {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #FFD814;
    color: #0F1111;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wc-shop-ui-sticky-cart:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    color: #0F1111;
}

.wc-shop-ui-sticky-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-shop-ui-sticky-cart-icon svg {
    width: 24px;
    height: 24px;
}

.wc-shop-ui-sticky-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #B12704;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide count badge when cart is empty */
.wc-shop-ui-sticky-cart:not(.has-items) .wc-shop-ui-sticky-cart-count {
    display: none;
}
