/* WooCommerce Specific Styles for Pip & Me */

/* =========================================
   1. SINGLE PRODUCT PAGE STYLES
   ========================================= */

/* --- Layout --- */
.product-page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    padding-top: calc(var(--header-height) + 2rem);
}

.product-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

@media (min-width: 992px) {
    .product-grid-layout {
        grid-template-columns: 7fr 5fr;
        gap: 4rem;
    }
}

/* --- Gallery (Left Col) --- */
.product-gallery-col { display: flex; flex-direction: column; gap: 1.5rem; }

.main-image-wrapper { 
    width: 100%; 
    aspect-ratio: 4 / 5; 
    background-color: #f0edea; 
    border-radius: 1rem; 
    overflow: hidden; 
    position: relative; 
}

.main-image { 
    width: 100%; 
    height: 100%; 
    background-size: cover; 
    background-position: center; 
    transition: transform 0.5s ease; 
}

.main-image-wrapper:hover .main-image { transform: scale(1.05); }

/* Zoom Hint */
.zoom-hint { 
    position: absolute; 
    bottom: 1.5rem; 
    right: 1.5rem; 
    background: rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(4px); 
    padding: 0.375rem 0.75rem; 
    border-radius: 999px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    color: var(--color-text-main); 
    display: flex; 
    align-items: center; 
    gap: 0.25rem; 
    opacity: 0; 
    transition: opacity 0.3s; 
    pointer-events: none;
}
.main-image-wrapper:hover .zoom-hint { opacity: 1; }

/* Arrows on Main Image */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: var(--color-text-main);
}
.main-image-wrapper:hover .gallery-nav { opacity: 1; }
.gallery-nav:hover { background: #fff; transform: translateY(-50%) scale(1.1); color: var(--color-primary); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* Thumbnails */
.thumbnails-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.thumb-btn { aspect-ratio: 1; border-radius: 0.5rem; overflow: hidden; border: 1px solid transparent; padding: 0; cursor: pointer; transition: all 0.2s; }
.thumb-btn.active { border: 2px solid var(--color-primary); }
.thumb-img { width: 100%; height: 100%; background-size: cover; background-position: center; }

/* --- Details (Right Col) --- */
.product-details-col { position: relative; }
.sticky-wrapper { position: sticky; top: calc(var(--header-height) + 2rem); }
.product-header { margin-bottom: 1.5rem; position: relative; }

.crafted-badge { 
    position: absolute; 
    top: -1.5rem; 
    right: 0; 
    transform: rotate(12deg); 
    background: rgba(255, 255, 255, 0.6); 
    backdrop-filter: blur(4px); 
    border: 1px solid rgba(255, 255, 255, 0.8); 
    padding: 0.25rem 0.75rem; 
    border-radius: 999px; 
    z-index: 10; 
}

.product-title { font-size: 2rem; line-height: 1.2; margin-bottom: 0.75rem; color: var(--color-text-main); }
.product-price { font-size: 1.5rem; font-weight: 500; color: var(--color-text-main); }
.product-description { font-size: 0.875rem; opacity: 0.8; margin-bottom: 2rem; line-height: 1.6; }

/* --- Customisation Panel --- */
.customise-panel {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.panel-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.6; margin-bottom: 1.5rem; }
.custom-field-group { margin-bottom: 1.5rem; }
.custom-label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--color-text-main); }

/* Icons Grid */
.icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; }
.icon-option input { display: none; }
.icon-box { aspect-ratio: 1; border-radius: 0.5rem; border: 1px solid rgba(56, 33, 30, 0.1); background: #fff; display: flex; align-items: center; justify-content: center; color: rgba(56, 33, 30, 0.6); cursor: pointer; transition: all 0.2s; }
.icon-option input:checked + .icon-box { border: 2px solid var(--color-primary); color: var(--color-primary); background: rgba(183, 130, 95, 0.05); }
.icon-box:hover { color: var(--color-primary); }

/* Input */
.input-wrapper { position: relative; }
.custom-input { width: 100%; background: #fff; border: 1px solid rgba(56, 33, 30, 0.1); border-radius: 0.5rem; padding: 0.75rem 1rem; font-family: var(--font-body); color: var(--color-text-main); }
.custom-input:focus { outline: none; border-color: var(--color-primary); }
.char-count { position: absolute; right: 0.75rem; top: 0.75rem; font-size: 0.75rem; opacity: 0.4; }

/* Color Picker */
.color-picker-wrapper { display: flex; align-items: center; gap: 1rem; }
.custom-color-input { -webkit-appearance: none; border: none; width: 3rem; height: 3rem; cursor: pointer; padding: 0; background: none; border-radius: 50%; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.custom-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color-input::-webkit-color-swatch { border: 2px solid #fff; border-radius: 50%; }
.color-code-hint { font-size: 0.75rem; opacity: 0.7; }

/* --- WooCommerce Variations --- */
.variations { width: 100%; border-spacing: 0; border-collapse: collapse; }
.variations tbody tr { display: flex; flex-direction: column; align-items: flex-start; } /* Stack Label/Input */
.variations td { padding: 0 0 1rem 0 !important; display: block; border: none !important; }
.variations label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--color-text-main); }
.variations select { width: 100%; padding: 0.75rem; border-radius: 0.5rem; border: 1px solid rgba(56, 33, 30, 0.2); background-color: #fff; }
.reset_variations { display: none !important; }

/* --- ACTIONS SECTION --- */
.woocommerce-variation-add-to-cart,
form.cart:not(.variations_form) {
    display: flex !important;
    flex-wrap: wrap;
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: flex-start !important;
    margin-top: 1rem;
}

/* Quantity Box - Inside Panel */
.woocommerce div.quantity.pip-qty-box {
    display: flex; align-items: center; justify-content:space-between; width: auto; min-width: 6rem; height: 2.5rem; flex-shrink: 0; background: #fff; border-radius: 0.5rem; border: 1px solid rgba(56, 33, 30, 0.2); padding: 0; overflow: visible; margin-top: 1.5rem !important; align-self: flex-start; position: relative;
}
.woocommerce div.quantity.pip-qty-box::before { position: absolute; top: -1.5rem; left: 0; font-size: 0.875rem; font-weight: 600; color: var(--color-text-main); line-height: 1; }

.pip-qty-btn { width: 2rem; height: 100%; background: transparent; border: none; color: var(--color-text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pip-qty-btn.minus { border-radius: 0.5rem 0 0 0.5rem; }
.pip-qty-btn.plus { border-radius: 0 0.5rem 0.5rem 0; }
.pip-qty-btn:hover { background-color: rgba(56, 33, 30, 0.05); color: var(--color-primary); }
.woocommerce div.quantity.pip-qty-box input.qty { width: 2rem; height: 100%; padding: 0; text-align: center; background: transparent; border: none !important; font-weight: 700; font-size: 0.875rem; color: var(--color-text-main); -moz-appearance: textfield; }
.woocommerce div.quantity input.qty::-webkit-outer-spin-button, .woocommerce div.quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Add to Cart Button */
.single_add_to_cart_button {
    width: 100% !important; background-color: #38211E !important; color: #e4ddce !important; font-weight: 700 !important; padding: 1rem 2rem !important; border-radius: 0.75rem !important; border: none !important; display: flex !important; align-items: center; justify-content: center; gap: 0.5rem; transition: background 0.3s; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); cursor: pointer; height: auto; min-height: 3.5rem; margin-top: 0.5rem !important;
}
.single_add_to_cart_button:hover { background-color: var(--color-primary) !important; }
.btn-icon-bag { font-family: 'Material Symbols Outlined'; font-weight: normal; font-size: 24px; line-height: 1; display: inline-block; white-space: nowrap; direction: ltr; }

/* Notices */
.woocommerce-notices-wrapper { margin-bottom: 2rem; width: 100%; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { background-color: #fff !important; border-top: 3px solid var(--color-primary) !important; color: var(--color-text-main) !important; padding: 1.5rem 2rem !important; border-radius: 0.5rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); margin-bottom: 1.5rem !important; display: flex; align-items: center; gap: 1rem; }
.woocommerce-error { border-top-color: #dc2626 !important; }
.woocommerce-message .button { float: right; background: transparent !important; color: var(--color-primary) !important; font-weight: 700; text-decoration: underline; border: none !important; padding: 0 !important; margin-left: 1rem; }

/* Features */
.product-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; padding: 3rem 0; margin-top: 3rem; border-top: 1px solid rgba(56, 33, 30, 0.05); border-bottom: 1px solid rgba(56, 33, 30, 0.05); background: rgba(255, 255, 255, 0.3); }
@media (min-width: 768px) { .product-features { grid-template-columns: repeat(4, 1fr); } }
.feature-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.75rem; }
.feature-icon { padding: 0.75rem; background: var(--color-bg-light); border-radius: 50%; color: var(--color-primary); display: flex; }
.feature-item h4 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; }
.feature-item p { font-size: 0.75rem; opacity: 0.7; max-width: 150px; }

/* === PRODUCT LONG DESCRIPTION – ENHANCED SINGLE COLUMN === */

.product-long-description--single {
    margin-top: 5rem;
    padding: 4.5rem 3rem;
    background: linear-gradient(180deg, #f6f3ec 0%, #f9f7f2 100%);
    border-radius: 1.5rem;
    box-shadow: 0 12px 30px rgba(56,33,30,0.08);
    position: relative;
    animation: fadeUp 0.6s ease both;
}

/* Section Title */
.product-long-description--single .section-title {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
    font-family: var(--font-display);
    color: var(--color-primary);
    text-align: center;
    position: relative;
}

/* Decorative divider */
.product-long-description--single .section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 1rem auto 0;
    border-radius: 3px;
    opacity: 0.8;
}

.product-long-description--single .description-inner {
    max-width: 820px;
    margin: 0 auto;
}

.product-long-description--single .description-text {
    font-size: 1.05rem;
    line-height: 1.95;
    color: var(--color-text-main);
    opacity: 0.95;
}

.product-long-description--single .description-text p {
    margin-bottom: 1.8rem;
}

/* Lists look nicer */
.product-long-description--single .description-text ul {
    padding-left: 1.2rem;
    margin: 2rem 0;
}

.product-long-description--single .description-text li {
    margin-bottom: 0.6rem;
}

/* Soft entrance animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Decorative divider below title */
.product-long-description h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.description-content {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-main);
    opacity: 0.9;
}

.description-content p {
    margin-bottom: 1.5rem;
}


/* ==========================================================================
   2. SHOP PAGE STYLES
   ========================================================================== */

/* Shop Header */
.pip-shop-header {
    background-color: #E5DECA; /* Soft Beige */
    padding: 6rem 1.5rem 4rem;
    text-align: center;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(56,33,30,0.05);
}

.pip-shop-subtitle {
    font-family: 'Courier Prime', monospace;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
    color: #B7825F;
    display: block;
    margin-bottom: 1rem;
    font-weight: 700;
}

.pip-shop-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #38211E;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.pip-shop-desc {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #38211E;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Shop Grid Container */
.shop-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 6rem;
}

/* --- PRODUCT GRID FIXES --- */
/* Kill Ghost Elements */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
    content: none !important;
    width: 0 !important;
}

/* Grid Setup */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: 1fr; /* 1 Column on Mobile */
    gap: 2rem;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

@media (min-width: 640px) {
    .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    /* 4 Columns for Desktop - Creates Smaller Images */
    .woocommerce ul.products { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
}

/* --- PRODUCT CARD --- */
.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    width: auto !important; /* Allow grid to sizing */
    margin: 0 !important;
    position: relative;
    background: transparent;
    float: none !important;
    clear: none !important; /* Clear fix removal */
}

/* Card Link */
.woocommerce ul.products li.product a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Card Image - 3:4 Aspect Ratio (Smaller) */
.woocommerce ul.products li.product a img {
    width: 100%;
    aspect-ratio: 3/4; /* 3:4 Portrait Ratio */
    object-fit: contain; /* Prevents cutting of image */
    border-radius: 1rem;
    background-color: transparent; /* No gray bars */
    transition: transform 0.6s ease;
    margin-bottom: 1rem !important;
    display: block;
    box-shadow: 0 4px 10px rgba(56,33,30,0.05);
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(56,33,30,0.1);
}

/* Card Title */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem; /* Slightly smaller for grid */
    color: #38211E;
    margin: 0 0 0.25rem;
    font-weight: 700;
    padding: 0;
    line-height: 1.3;
}

/* Card Price */
.woocommerce ul.products li.product .price {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.95rem;
    color: #38211E;
    font-weight: 400;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.woocommerce ul.products li.product .price del { opacity: 0.5; margin-right: 0.5rem; }
.woocommerce ul.products li.product .price ins { text-decoration: none; font-weight: 700; }

/* Add to Cart Button (on Grid) */
.woocommerce ul.products li.product .button {
    display: inline-block;
    width: 100%;
    text-align: center;
    background-color: #fff;
    border: 1px solid #38211E;
    color: #38211E;
    border-radius: 0.75rem;
    padding: 0.7rem;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    margin-top: auto; /* Push to bottom */
    text-decoration: none;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #38211E;
    color: #E5DECA;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(56,33,30,0.1);
}

.woocommerce ul.products li.product .button.loading { opacity: 0.7; }
.woocommerce ul.products li.product .button.added { background-color: #E5DECA; color: #38211E; border-color: #E5DECA; }

/* --- PAGINATION --- */
.woocommerce-pagination { margin-top: 5rem; text-align: center; }
.woocommerce-pagination ul { display: inline-flex; gap: 0.5rem; border: none !important; }
.woocommerce-pagination ul li { border: none !important; overflow: visible; float: none; display: inline-block; }
.woocommerce-pagination ul li a, .woocommerce-pagination ul li span {
    display: flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(56,33,30,0.1);
    color: #38211E;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
    padding: 0;
}
.woocommerce-pagination ul li a:hover, .woocommerce-pagination ul li span.current {
    background-color: #38211E;
    color: #E5DECA;
    border-color: #38211E;
}

/* Utilities */
.woocommerce-result-count { display: none; }
.woocommerce-ordering { margin-bottom: 2rem; float: right; }
.woocommerce-ordering select {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(56,33,30,0.2);
    background: #fff;
    color: #38211E;
    font-family: 'Libre Baskerville', serif;
}