/* Single Product Page Styles - Replaces Tailwind */

:root {
    --sp-color-bg: #FFF9F4;
    --sp-color-bg-dark: #F5EBE0;
    --sp-color-gold: #C89F65;
    --sp-color-gold-hover: #B08855;
    --sp-color-gold-light: #EEDCC6;
    --sp-color-text-main: #2D2A26;
    --sp-color-text-muted: #7A7570;
    --sp-color-white: #ffffff;
    --sp-color-green: #4C8F48;
    --sp-color-red: #ef4444;
    
    --sp-shadow-float: 0 8px 30px rgba(0,0,0,0.04);
    --sp-shadow-soft: 0 10px 40px -10px rgba(200, 159, 101, 0.15);
    
    --sp-font-sans: 'Mulish', sans-serif;
}

/* Base Wrapper */
.sp-product-wrapper {
    background-color: transparent;
    color: var(--sp-color-text-main);
    font-family: var(--normal-font);
    padding-bottom: 6rem;
}

@media (min-width: 1024px) {
    .sp-product-wrapper {
        padding-bottom: 0;
    }
}

/* Promo Bar */
.sp-promo-bar {
    background-color: var(--sp-color-gold);
    color: var(--sp-color-white);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 0.5rem 0;
    font-weight: 600;
}

/* Container */
.sp-container {
    max-width: 80rem; /* 7xl approx */
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 1024px) {
    .sp-container {
        padding: 0 2rem;
    }
}

/* Breadcrumbs */
.sp-breadcrumbs {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.sp-breadcrumbs nav {
    display: flex;
    font-size: 0.75rem; /* xs */
    font-weight: 500;
    color: var(--sp-color-text-muted);
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
}

.sp-breadcrumbs a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.sp-breadcrumbs a:hover {
    color: var(--sp-color-gold);
}

.sp-breadcrumb-delim {
    color: #d1d5db; /* gray-300 */
}

/* Main Section Layout */
.sp-main-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.sp-grid-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .sp-grid-layout {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 4rem;
        align-items: start;
    }
    
    .sp-gallery-col {
        grid-column: span 7;
        display: flex;
        flex-direction: column-reverse;
        gap: 1.5rem;
        position: sticky;
        top: 7rem;
        align-self: start;
        height: fit-content;
    }
    
    .sp-info-col {
        grid-column: span 5;
        margin-top: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }
}

/* Gallery Styles */
.sp-gallery-col {
    display: flex;
    flex-direction: column-reverse; /* Mobile: Thumbs below */
    gap: 1.5rem;
}

/* Thumbnails */
.sp-thumbnails {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: auto;
    scrollbar-width: thin;
    touch-action: pan-x;
}

@media (min-width: 1024px) {
    .sp-thumbnails {
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
        padding: 0;
        overflow-x: auto;
    }
}

.sp-thumbnails::-webkit-scrollbar {
    height: 8px;
}
.sp-thumbnails::-webkit-scrollbar-thumb {
    background-color: rgba(200, 159, 101, 0.5);
    border-radius: 9999px;
}
.sp-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.sp-thumb-btn {
    border: 2px solid transparent;
    border-radius: 1rem; /* rounded-2xl */
    overflow: hidden;
    height: 6rem;
    width: 6rem;
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s;
    background: none;
    padding: 0;
}

.sp-thumb-btn:hover, .sp-thumb-btn.active {
    opacity: 1;
    transform: scale(1.05);
}

.sp-thumb-btn.active {
    border-color: var(--sp-color-gold);
}

.sp-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Image */
.sp-main-image-wrapper {
    position: relative;
    width: 100%;
    background-color: white;
    border-radius: 2.5rem;
    box-shadow: var(--sp-shadow-float);
    overflow: hidden;
    aspect-ratio: 4/5;
    cursor: zoom-in;
}

@media (min-width: 1024px) {
    .sp-main-image-wrapper {
        height: 650px;
    }
}

.sp-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: opacity 0.2s;
}

.sp-lightbox {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.sp-lightbox.hidden {
    display: none;
}
.sp-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--sp-shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.sp-lightbox-image {
    max-width: 88vw;
    max-height: 80vh;
    object-fit: contain;
}
.sp-lightbox-close,
.sp-lightbox-prev,
.sp-lightbox-next {
    position: absolute;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: white;
    color: var(--sp-color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.sp-lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
}
.sp-lightbox-prev {
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}
.sp-lightbox-next {
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Labels & Wishlist */
.sp-labels {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sp-label-sale, .sp-label-bestseller {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: var(--sp-color-text-main);
    font-size: 10px;
    font-weight: 700;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.sp-wishlist-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-color-text-main);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.sp-wishlist-btn:hover {
    background-color: white;
    color: var(--sp-color-red);
}

/* Product Info */
.sp-header-area {
    margin-bottom: 1.5rem;
}

.sp-rating-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sp-stars {
    color: var(--sp-color-gold);
    font-size: 0.75rem;
}

.sp-review-count {
    font-size: 0.75rem;
    color: var(--sp-color-text-muted);
    font-weight: 500;
}

.sp-title {
    font-size: 1.875rem; /* 3xl */
    line-height: 1.25;
    font-family: var(--title-font);
    font-weight: 500;
    color: var(--sp-color-text-main);
    margin: 0;
}

@media (min-width: 1024px) {
    .sp-title {
        font-size: 2.25rem; /* 4xl */
    }
}

.sp-excerpt {
    margin-top: 1rem;
    color: var(--sp-color-text-muted);
    line-height: 1.625;
    font-weight: 300;
}

/* Price Box */
.sp-price-box {
    background-color: white;
    border-radius: 2rem;
    padding: 1.5rem;
    box-shadow: var(--sp-shadow-float);
    border: 1px solid white;
}

@media (min-width: 1024px) {
    .sp-price-box {
        padding: 2rem;
    }
}

.sp-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.sp-volume {
    font-size: 0.875rem;
    color: var(--sp-color-text-muted);
    font-weight: 500;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.sp-price {
    font-size: 2.25rem; /* 4xl */
    font-weight: 300;
    color: var(--sp-color-text-main);
}
.sp-price ins {
    text-decoration: none;
}
.sp-price del {
    font-size: 1rem;
    color: var(--sp-color-text-muted);
    opacity: 0.6;
}

.sp-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sp-stock i {
    color: var(--sp-color-green);
    font-size: 0.875rem;
}

.sp-stock span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sp-color-text-main);
}

/* Add to Cart Form */
.sp-cart-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sp-qty-wrapper {
    display: flex;
    align-items: center;
    background-color: rgb(255 249 244 / var(--tw-bg-opacity, 1));
    border-radius: 9999px;
    height: 3.5rem;
    padding: 0 0.5rem;
    width: 8rem;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.sp-qty-wrapper:focus-within {
    border-color: var(--sp-color-gold);
}

.sp-qty-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sp-color-text-muted);
    transition: background 0.2s;
}

.sp-qty-btn:hover {
    background-color: white;
}

.sp-qty-input {
    width: 100%;
    text-align: center;
    background: transparent;
    border: none;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--sp-color-text-main);
    padding: 0;
    -moz-appearance: textfield;
}
.sp-qty-input::-webkit-inner-spin-button, 
.sp-qty-input::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

.sp-add-btn {
    flex: 1;
    background-color: var(--sp-color-gold);
    color: var(--sp-color-white);
    border-radius: 9999px;
    height: 3.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(200, 159, 101, 0.3);
    transition: all 0.2s;
}

.sp-add-btn:hover {
    background-color: var(--sp-color-gold-hover);
    box-shadow: 0 20px 25px -5px rgba(200, 159, 101, 0.5);
}

/* Meta Grid */
.sp-meta-grid {
    padding-top: 1.5rem;
    border-top: 1px dashed #e5e7eb;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .sp-meta-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.sp-meta-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sp-meta-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-color-text-main);
    flex-shrink: 0;
}

.sp-meta-header h4 {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--sp-color-text-main);
    margin: 0;
}

.sp-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--sp-color-text-muted);
    font-weight: 300;
    padding-left: 2.75rem;
}

@media (min-width: 640px) {
    .sp-meta-list {
        padding-left: 0;
    }
}

.sp-meta-item-content {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.sp-meta-label {
    font-weight: 500;
    color: var(--sp-color-text-main);
}

.sp-payment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .sp-title {
        font-size: 1.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sp-review-count {
        font-size: 0.6875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sp-excerpt {
        font-size: 0.875rem;
    }
    .sp-price {
        font-size: 1.875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sp-volume {
        font-size: 0.8125rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sp-meta-list {
        font-size: 0.8125rem;
    }
    .sp-meta-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sp-accordion-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 500px) {
    .sp-related-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 0 12px;
    }
    .sp-related-title {
        width: 100%;
    }
    .sp-related-section .slider-arrow {
        width: 100%;
        justify-content: flex-end;
    }
    .sp-related-link {
        width: 100%;
        display: block;
        margin-left: 0;
        text-align: right;
    }
    .sp-price-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .sp-stock {
        width: 100%;
    }
    .sp-cart-form {
        flex-direction: column;
        align-items: stretch;
    }
    .sp-add-btn {
        width: 100%;
        padding: 15px;
    }
}

@media (min-width: 768px) {
    .sp-related-section .slider-arrow {
        display: none;
    }
}
}

/* Badges */
.sp-badges {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: transparent;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    color: var(--sp-color-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Accordion */
.sp-accordion {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sp-accordion-btn {
    width: 100%;
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.sp-accordion-btn:hover {
    border-color: rgba(200, 159, 101, 0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.sp-accordion-btn:hover .sp-accordion-icon {
    background-color: var(--sp-color-gold);
    color: white;
}

.sp-accordion-title {
    font-weight: 500;
    color: var(--sp-color-text-main);
}

.sp-accordion-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sp-accordion-content {
    padding: 0 1.5rem 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--sp-color-text-muted);
    font-weight: 300;
    line-height: 1.6;
}

.sp-accordion-content.hidden {
    display: none;
}

.sp-accordion-content ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0.5rem 0 1rem;
}
.sp-accordion-content ol {
    list-style: decimal;
    padding-left: 1.25rem;
    margin: 0.5rem 0 1rem;
}
.sp-accordion-content li {
    margin-bottom: 0.375rem;
}
.sp-accordion-content ul ul,
.sp-accordion-content ol ol {
    margin-top: 0.25rem;
}

/* Related Products */
.sp-related-section {
    margin-top: 6rem;
    margin-bottom: 4rem;
}

.sp-related-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.sp-related-title {
    font-size: 1.5rem;
    font-family: var(--title-font);
    color: var(--sp-color-text-main);
    margin: 0;
}

.sp-related-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sp-color-gold);
    border-bottom: 1px solid rgba(200, 159, 101, 0.3);
    text-decoration: none;
    padding-bottom: 0.125rem;
    transition: color 0.2s;
    margin-left: auto;
}

.sp-related-link:hover {
    color: var(--sp-color-gold-hover);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Fix for Quantity Buttons Duplication --- */
.sp-qty-wrapper .quantity {
    display: flex;
    align-items: center;
    border: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.sp-qty-wrapper .quantity .minus,
.sp-qty-wrapper .quantity .plus,
.sp-qty-wrapper .quantity > label {
    display: none !important;
}

/* Ensure input styling inside the wrapper */
.sp-qty-wrapper .quantity input.qty {
    width: 100%;
    text-align: center;
    background: transparent;
    border: none;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--sp-color-text-main);
    padding: 0;
    -moz-appearance: textfield;
}

/* --- Fix for Related Products Carousel (Horizontal Scroll) --- */
.sp-related-section .related.products ul.products {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    scrollbar-width: none; /* Hide scrollbar Firefox */
    margin: 0;
}

.sp-related-section .related.products ul.products::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.sp-related-section .related.products ul.products li.product {
    flex: 0 0 280px; /* Fixed width cards */
    scroll-snap-align: start;
    list-style: none;
    margin: 0;
    width: 280px; /* Explicit width */
}

/* Optional: Ensure product images inside carousel look good */
.sp-related-section .related.products ul.products li.product img {
    border-radius: 1.5rem; /* rounded-3xl approx */
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: contain;
    margin-bottom: 1rem;
}

.sp-related-section .related.products ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem;
    color: var(--sp-color-text-main);
    font-weight: 500;
}

.sp-related-section .related.products ul.products li.product .price {
    color: var(--sp-color-text-muted);
    font-size: 0.875rem;
}

/* --- Improved Card Styling for Related Products --- */

/* Card Container */
.sp-related-section .related.products ul.products li.product {
    flex: 0 0 280px;
    width: 280px;
    scroll-snap-align: start;
    list-style: none;
    margin: 0;
    position: relative;
    padding-bottom: 1rem;
}

/* Link Wrapper (contains Image + Title + Price usually) */
.sp-related-section .related.products ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

/* Image Styling */
.sp-related-section .related.products ul.products li.product img {
    border-radius: 1.5rem; /* rounded-3xl */
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: contain;
    margin-bottom: 1rem;
    transition: transform 0.7s ease;
    background-color: white;
}

/* Hover Effect on Image */
.sp-related-section .related.products ul.products li.product:hover img {
    transform: scale(1.05);
}

/* Title Styling */
.sp-related-section .related.products ul.products li.product .woocommerce-loop-product__title {
    font-size: 1rem;
    color: var(--sp-color-text-main);
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    padding: 0 0.5rem;
    transition: color 0.2s;
    font-family: var(--medium-font);
}

.sp-related-section .related.products ul.products li.product:hover .woocommerce-loop-product__title {
    color: var(--sp-color-gold);
}

/* Price Styling */
.sp-related-section .related.products ul.products li.product .price {
    color: var(--sp-color-text-muted);
    font-size: 0.875rem;
    display: block;
    padding: 0 0.5rem;
    margin: 0;
    font-weight: 400;
}

.sp-related-section .related.products ul.products li.product .price ins {
    text-decoration: none;
    font-weight: 600;
}

/* Add to Cart Button (Floating Style) */
/* Positioned relative to the card, visually placed over the bottom-right of the image */
.sp-related-section .related.products ul.products li.product .button {
    position: absolute;
    top: 310px; /* Image height (373px) - button height (40px) - padding (24px) approx */
    right: 1.5rem;
    width: 2.5rem; /* 10 in tailwind = 2.5rem */
    height: 2.5rem;
    border-radius: 50%;
    background-color: white;
    color: var(--sp-color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0; /* Hide text */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 20;
    border: none;
    cursor: pointer;
}

/* FontAwesome Plus Icon */
.sp-related-section .related.products ul.products li.product .button::after {
    content: '\f067'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1rem;
}

/* Hover State for Button */
.sp-related-section .related.products ul.products li.product:hover .button {
    opacity: 1;
    transform: translateY(0);
}

.sp-related-section .related.products ul.products li.product .button:hover {
    background-color: var(--sp-color-gold);
    color: white;
}

/* Fix for Sale Flash if present */
.sp-related-section .related.products ul.products li.product .onsale {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--sp-color-gold);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
    min-height: auto;
    min-width: auto;
    line-height: normal;
}

/* --- Refactored Related Products Loop Styling --- */

/* Wrapper for Image and Floating Elements */
.sp-related-img-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 1.5rem; /* rounded-3xl */
    aspect-ratio: 3/4;
}

/* Image inside wrapper */
.sp-related-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.7s ease;
    border-radius: 0; /* Reset because wrapper handles radius */
    margin-bottom: 0 !important;
}

/* Hover Zoom */
.sp-related-section .related.products ul.products li.product:hover .sp-related-img-wrapper img {
    transform: scale(1.05);
}

/* Floating Add to Cart Button */
.sp-related-img-wrapper .button.add_to_cart_button {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: white;
    color: var(--sp-color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 20;
    cursor: pointer;
    top: auto; /* Reset inherited top */
}

/* Show button on hover */
.sp-related-section .related.products ul.products li.product:hover .sp-related-img-wrapper .button.add_to_cart_button {
    opacity: 1;
    transform: translateY(0);
}

.sp-related-img-wrapper .button.add_to_cart_button:hover {
    background-color: var(--sp-color-gold);
    color: white;
}

/* Sale Badge inside wrapper */
.sp-related-img-wrapper .onsale {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--sp-color-gold);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
    min-height: auto;
    min-width: auto;
    line-height: normal;
    right: auto;
    bottom: auto;
    margin: 0;
}

/* Variable product styling */
.variable-product-wrapper {
    margin-top: 1rem;
}
.variable-product-wrapper form.cart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.variable-product-wrapper .variations {
    width: 100%;
    border: none !important;
}
.variable-product-wrapper .variations tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0;
}
.variable-product-wrapper .variations td.label {
    color: var(--sp-color-text-main);
    font-weight: 600;
    font-size: 0.875rem;
}
.variable-product-wrapper .variations td.value select {
    width: 100%;
    background-color: transparent;
    border-radius: 9999px;
    height: 3rem;
    padding: 0 1rem;
    border: 1px solid transparent;
}
.variable-product-wrapper .reset_variations {
    font-size: 0.75rem;
    color: var(--sp-color-text-muted);
    text-decoration: underline;
}
.variable-product-wrapper .single_variation {
    margin: 0.5rem 0;
}
.variable-product-wrapper .single_variation .price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--sp-color-text-main);
}
.variable-product-wrapper .single_variation_wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.variable-product-wrapper .single_variation_wrap .quantity {
    background-color: transparent;
    border-radius: 9999px;
    padding: 0 0.5rem;
    height: 3rem;
    display: flex;
    align-items: center;
}
.variable-product-wrapper .single_variation_wrap .quantity input.qty {
    background: transparent;
    border: none;
    width: 4rem;
    text-align: center;
    -moz-appearance: textfield;
}
.variable-product-wrapper .single_variation_wrap .single_add_to_cart_button {
    background-color: var(--sp-color-gold);
    color: var(--sp-color-white);
    border: none;
    border-radius: 9999px;
    height: 3rem;
    padding: 0 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(200, 159, 101, 0.3);
    transition: all 0.2s;
}
.variable-product-wrapper .single_variation_wrap .single_add_to_cart_button:hover {
    background-color: var(--sp-color-gold-hover);
}

/* --- Fix for sticky gallery not working --- */
/* The parent .alko-main-content has overflow: hidden, which breaks sticky positioning on descendants */
body.single-product .alko-main-content {
    overflow: visible !important;
}

/* --- Fix for Checkout Review Order Background --- */
form.woocommerce-checkout .woocommerce-checkout-review-order {
    background: transparent !important;
}
