.product-page-main {
    padding: 0; /* Touches header */
    width: 100%;
    max-width: 100%;
    /* Removed overflow-x: hidden to prevent breaking position: sticky */
}

.opsim-product-single {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* --- Gallery Section (Edge-to-Edge, No Borders) --- */
.product-gallery {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0 10px; /* Refined mobile side gaps */
}

.main-image-container {
    width: 100%;
    margin: 5px 0 0 0;
    padding: 0;
}

.main-image-wrapper {
    width: 100%;
}

.main-image-wrapper .main-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05); /* Subtle border for white backgrounds */
}

/* Thumbnails */
.product-thumbnails {
    display: flex;
    width: 100%;
    margin: 10px 0;
    padding: 0;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Professional fading effect on edges */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10px, black calc(100% - 10px), transparent);
    mask-image: linear-gradient(to right, transparent, black 10px, black calc(100% - 10px), transparent);
}
.product-thumbnails::-webkit-scrollbar {
    display: none;
}

.thumb-item {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    cursor: pointer;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    opacity: 0.6;
    transition: all 0.2s ease;
    overflow: hidden;
}

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

.thumb-item.active {
    opacity: 1;
    border-color: var(--opsim-brand, #355872);
}

/* --- Summary Section --- */
.product-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 10px 30px 10px; /* Matching refined gaps */
    width: 100%;
    text-align: center; /* Original aesthetic preserved */
}

.product-title {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.3;
    color: #111827;
    text-transform: uppercase;
}

.product-price-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.price-main {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--opsim-brand, #355872);
}

.price-main .currency {
    font-size: 0.9rem;
    font-weight: 600;
}

.price-compare {
    font-size: 0.9rem;
    color: #9CA3AF;
    text-decoration: line-through;
    font-weight: 400;
}

/* --- Desktop Layout --- */
@media (min-width: 992px) {
    .product-page-main {
        max-width: 1300px;
        margin: 0 auto;
        padding-top: 40px; 
        padding-bottom: 40px;
    }

    .opsim-product-single {
        flex-direction: row;
        align-items: flex-start;
        gap: 40px; /* Reduced gap to align closer to image edge */
        padding: 0 40px;
    }

    .product-gallery {
        flex: 0 0 45%; /* Slightly smaller gallery */
        max-width: 45%;
        padding: 0; /* Reset mobile side gaps on desktop */
        position: -webkit-sticky; /* Safari support */
        position: sticky;
        top: 120px; /* Offset for header */
        align-self: flex-start; /* CRITICAL for sticky in flex */
        z-index: 10;
    }

    /* Adjust Gallery for WordPress Admin Bar */
    .admin-bar .product-gallery {
        top: 152px; /* 120px + 32px admin bar */
    }

    .product-summary {
        flex: 1;
        padding: 0; /* Zero padding to align title perfectly with image top */
        text-align: left; /* Align text to side on desktop */
    }

    .product-price-box {
        justify-content: flex-start; /* Align price to side on desktop */
    }
    
    .product-title {
        font-size: 1.25rem; /* Small but legible desktop size */
        margin-top: -4px; /* Tiny adjustment to hit the image edge perfectly */
        text-align: left;
    }
}

/* --- Product Description Below Checkout --- */
.product-description-content {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    color: #4B5563;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left; /* Keep description on the side as requested */
}

.product-description-content p {
    margin-bottom: 15px;
}

.product-description-content ul, 
.product-description-content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.product-description-content li {
    margin-bottom: 8px;
}

.product-description-content h2,
.product-description-content h3 {
    color: #111827;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 20px 0 10px 0;
}

/* --- Mobile Sticky ATC Bar --- */
.sticky-checkout-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 8px 15px;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.05);
    z-index: 99999; 
    transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.sticky-checkout-bar.is-visible {
    transform: translateY(0);
}

.sticky-atc-btn {
    width: 100%;
    background: var(--opsim-brand, #355872);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sticky-btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.sticky-btn-inner .main-text {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.sticky-atc-btn .icon {
    display: flex;
    flex-shrink: 0;
}

.sticky-atc-btn .icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

@media (max-width: 380px) {
    .sticky-btn-inner {
        gap: 8px;
    }
    .sticky-btn-inner .main-text {
        font-size: 12px;
    }
}


/* @media (min-width: 992px) {
    .sticky-checkout-bar {
        display: none !important;
    }
} */

.sticky-checkout-bar {
    border-top: 1px solid rgba(0,0,0,0.1);
}

