/* ══════════════════════════════════════════════════════════
   SINGLE PRODUCT PAGE
   woodworkstore.fr / ustolarzy theme
   ══════════════════════════════════════════════════════════ */

:root {
    --product-accent: var(--color-orange);
    --product-bg-detail: #FDFDFD;
}

.product-page {
    /* Offset for fixed header + a light gap */
    padding-top: calc(var(--header-height) + var(--header-topbar-height) + 12px);
}

@media (max-width: 1024px) {
    .product-page {
        /* Increased offset for mobile as topbar text might wrap */
        padding-top: calc(var(--header-height) + var(--header-topbar-height) + 40px);
    }
}


/* ── LAYOUT ───────────────────────────────────── */
.container--product-main {
    display: flex;
    align-items: flex-start;
    gap: clamp(40px, 6vw, 80px);
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .container--product-main {
        flex-direction: column;
    }

    .product-gallery-view {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }
}

.product-page .global-features {
    margin: clamp(3rem, 6vw, 6rem) 0;
}

/* ── PROMO VIDEO ────────────────────────────── */
.product-promo-video-section {
    margin: 4rem 0;
}

.promo-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    box-shadow: var(--shadow-lg);
}

.promo-video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}



/* Container refactored to flex-wrap with min-width on children, media query removed */

/* ── GALLERY (Migrated from Gallery Pro) ──────── */
.product-gallery-view {
    flex: 1 1 0;
    min-width: 200px;
}

.agm-main-container {
    width: 100%;
}

.agm-gallery-outer {
    position: relative;
    width: 100%;
}

.agm-gallery-wrapper {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
}

.agm-cell {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    width: 100%;
    background: var(--color-beige);
    transition: transform 0.4s;
}

.agm-img,
.agm-cell picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (hover: hover) {
    .agm-cell:hover {
        transform: scale(0.98);
    }
}

/* GŁÓWNE: Mosaic logic */
.d-cell-1 {
    grid-column: span 6;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
}

.d-cell-1 .agm-img {
    object-fit: cover;
}

.d-cell-2 {
    grid-column: span 3;
    aspect-ratio: 4 / 3;
}

.d-cell-3 {
    grid-column: span 2;
    aspect-ratio: 4 / 3;
}

@media (max-width: 1024px) {
    .agm-gallery-wrapper {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0;
        scrollbar-width: none;
        border-radius: 8px;
        margin: 0 calc(var(--container-padding) * -1);
        width: calc(100% + var(--container-padding) * 2);
    }

    .agm-gallery-wrapper::-webkit-scrollbar {
        display: none;
    }

    .agm-cell {
        min-width: 100%;
        scroll-snap-align: start;
        border-radius: 8px;
        aspect-ratio: 4 / 3;
    }

    .d-cell-1,
    .d-cell-2,
    .d-cell-3 {
        grid-column: auto;
        height: auto;
        margin-bottom: 0;
    }

    .d-cell-1 {
        border-radius: 8px;
    }

    .agm-pagination {
        display: flex;
        position: absolute;
        bottom: 20px;
        left: 20px;
        gap: 8px;
        z-index: 5;
    }

    .agm-dot {
        width: 8px;
        height: 8px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        transition: 0.3s;
    }
}

/* LIGHTBOX PREMIUM UI */
.agm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    display: none;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.agm-overlay.is-active {
    display: flex;
}

.agm-full-view {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.agm-close,
.agm-nav {
    background: none !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer;
    position: absolute;
    z-index: 100;
    opacity: 0.7;
    transition: 0.3s;
}

.agm-close:hover,
.agm-nav:hover {
    opacity: 1;
    transform: scale(1.1);
}

.agm-close {
    top: 4%;
    right: 4%;
    font-size: 60px;
    font-weight: 100;
    line-height: 1;
}

.agm-nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 80px;
    font-weight: 100;
}

.agm-prev {
    left: 4%;
}

.agm-next {
    right: 4%;
}

/* ── SUMMARY (Right) ─────────────────────────── */
.product-summary {
    flex: 0 0 575px;
    max-width: 575px;
    position: sticky;
    top: calc(var(--header-height) + var(--header-topbar-height) + 80px);
    align-self: flex-start;
    max-height: calc(100vh - (var(--header-height) + var(--header-topbar-height) + 120px));
    overflow-y: auto;
    scrollbar-width: none;
    padding-bottom: 12px;
}


.product-summary::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Edge */
}

@media (max-width: 1024px) {
    .product-summary {
        flex: 1 1 100%;
        max-width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}


.product-collection,
.product-brand {
    display: block;
    font-family: var(--font-body);
    font-size: clamp(18px, 4vw, 20px);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--color-orange);
    margin: 0;
}

.product-title {
    font-family: var(--font-body);
    font-size: clamp(12px, 4vw, 14px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0.1px;
    color: var(--color-text);
    margin: 0 0 1.5rem;
}

.product-price-section {
    font-family: var(--font-body);
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.sale-price.price-highlight {
    color: #C0392B;
    font-weight: 600;
    font-size: 24px;
    font-family: var(--font-label);
    margin-right: 6px;
}

.regular-price.price-strikethrough {
    font-size: 15px;
    font-weight: 400;
    color: #999;
}

.regular-price.price-normal {
    font-weight: 500;
}

.omnibus-info {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
    font-weight: 400;
}

/* Stock pod przyciskiem, wyrównany do prawej */
.stock.in-stock {
    font-size: 12px;
    color: #333;
    text-align: right;
    display: block;
    margin-top: 8px;
    float: none;
}

/* Variable: reorder — stock (prio 10) pod przyciskiem (prio 20) */
.single_variation_wrap {
    display: flex;
    flex-direction: column;
}
.woocommerce-variation {
    order: 2;
}
.woocommerce-variation-add-to-cart {
    order: 1;
}

.product-price-custom-wrap {
    margin-top: 1.5rem;
}

.single_variation_wrap {
    width: 100%;
}

/* Hide default variation price as we use custom one */
.single_variation_wrap .woocommerce-variation-price {
    display: none !important;
}

.product-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.badge {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border-radius: 8px;
}

.badge--sale,
.badge--presale {
    background: #3a3a3a;
    color: var(--color-white);
}


/* ── SHORT DESCRIPTION: List with Ticks ──────── */
.product-short-description {
    font-size: 13px;
    line-height: 1.6;
    color: #454545B3;
    margin-bottom: 2rem;
}

.product-short-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-short-description li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 8px;
}

.product-short-description li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    background-color: var(--color-orange);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") no-repeat center;
}

/* ── ATTRIBUTES GRID ──────── */
.product-attributes-grid {
    display: flex;
    gap: 24px;
    width: fit-content;
    padding: 10px 0;
}

.attribute-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attribute-icon {
    width: 30px;
    height: 30px;
    background: #F6F6F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attribute-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.attribute-details {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.attribute-label {
    font-size: 10px;
    color: #666;
    margin-bottom: 2px;
}

.attribute-value {
    font-size: 13px;
    font-weight: 600;
    color: #3a3a3a;
}

@media (max-width: 768px) {
    .product-attributes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .product-attributes-grid {
        grid-template-columns: 1fr;
    }
}

/* ── PRODUCT COLLECTION BOX (Improved) ───────────────── */
.section-product-collection {
    padding: 6rem 0;
    background-color: var(--color-bg-page);
}

.product-collection-box {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    align-items: flex-start;
}

.left-colection-col {
    width: 55%;
    display: flex;
    flex-direction: column;
}

.right-colection-col {
    flex: 1;
    display: flex;
}

.col-title {
    font-family: var(--font-label);
    font-size: 14px;
    font-weight: 40;
    color: var(--color-heading);
    display: block;
}

.product-collection-title {
    font-family: var(--font-heading);
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 400;
    margin: 0 0 1rem 0;
    line-height: 1.1;
}

.product-collection-title a {
    color: var(--color-navs);
    text-decoration: none;
}

.product-collection-description {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
    color: #454545CC;
    max-width: 680px;
    margin-bottom: 1.5rem;
}

.product-collection-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.gallery-item {
    width: 140px;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--color-beige);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s;
    border: 2px solid transparent;
}

.gallery-item.active img {
    border-color: var(--color-orange);
}

@media (hover: hover) {
    .gallery-item:hover {
        transform: translateY(-4px);
    }

    .gallery-item:hover img {
        transform: scale(1.08);
    }
}

.product-collection-button {
    margin-top: 1rem;
}

.btn-collection {
    display: inline-block;
    padding: 16px 40px;
    color: var(--color-text);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--color-text);
}

.btn-collection:hover {
    background-color: var(--color-navs);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-collection-main-image {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: var(--color-beige);
    box-shadow: var(--shadow-md);
}

.product-collection-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .product-collection-box {
        flex-direction: column-reverse;
        gap: 40px;
    }

    .left-colection-col,
    .right-colection-col {
        width: 100%;
    }

    .product-collection-gallery {
        gap: 12px;
    }

    .gallery-item {
        width: 110px;
    }

    .product-collection-main-image {
        aspect-ratio: 16 / 9;
        max-height: 500px;
    }
}

@media (max-width: 1024px) {
    .product-collection-gallery {
        display: none;
        /* Hide complex gallery on small tablets/mobile */
    }
}

@media (max-width: 768px) {
    .section-product-collection {
        padding: 4rem 0;
    }

    .product-collection-title {
        font-size: 28px;
    }

    .btn-collection {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
    }
}

/* ── HEIGHT NOTICE ──────── */
.product-height-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
    margin-bottom: .35rem;
}

/* Variations & Cart */
.product-add-to-cart {
    margin-bottom: 3rem;
    padding-top: 2rem;
}

/* Variations Form (DIV based) */
.variations-custom-form {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 450px;
    /* Consistent width for inputs section */
}

.variation-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.variation-row .label-col {
    flex: 0 0 100px;
}

.variation-row .label-col label {
    font-size: 13px;
    font-weight: 400;
    color: #333;
    text-transform: none;
    margin: 0;
    font-family: var(--font-label);
    letter-spacing: 0;
}

.variation-row .value-col {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.variation-row .value-col select {
    width: 100%;
    height: 48px;
    padding: 0 45px 0 15px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: #fff !important;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.reset_variations {
    font-size: 12px;
    color: #999;
    text-decoration: none;
    white-space: nowrap;
}

.reset_variations:hover {
    color: #B58A60;
}

/* Add to Cart Section Wrapper */
.product-add-to-cart .cart {
    display: block !important;
    width: 100%;
    margin-top: 20px;
}

/* Only flex the container of quantity + button */
.product-add-to-cart .cart:not(.variations_form),
.woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-flow: row wrap;
    align-items: center !important;
    gap: 15px !important;
    margin-top: 15px;
    width: 100%;
}

/* Custom Quantity Selector (Pill Shape) */
.quantity {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border: 1px solid #B7B7B7 !important;
    border-radius: 100px !important;
    height: 48px !important;
    width: 120px !important;
    min-width: 120px !important;
    padding: 0 15px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    position: relative;
}

.qty-btn {
    width: 24px;
    height: 100%;
    border: none !important;
    background: none !important;
    font-size: 18px;
    font-weight: 300;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
    user-select: none;
    padding: 0 !important;
    z-index: 2;
}

.qty-btn:hover {
    color: #B58A60;
}

.quantity input.qty {
    width: 50px !important;
    height: 100% !important;
    border: none !important;
    background: none !important;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    padding: 0 !important;
    margin: 0 !important;
    -moz-appearance: textfield;
}

.quantity input.qty::-webkit-outer-spin-button,
.quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to Cart Button */
.single_add_to_cart_button {
    flex: 1;
    max-width: none;
    height: 48px;
    padding: 0 20px;
    background: #B58A60 !important;
    color: #fff !important;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.02em;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single_add_to_cart_button:hover {
    background: #a07954 !important;
}

.single_add_to_cart_button.disabled,
.single_add_to_cart_button:disabled {
    background: #CCC;
    cursor: not-allowed;
}

@media (max-width: 480px) {

    .product-add-to-cart .cart:not(.variations_form),
    .woocommerce-variation-add-to-cart {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .quantity {
        flex: 0 0 35% !important;
        width: 35% !important;
        min-width: 0 !important;
    }

    .single_add_to_cart_button {
        flex: 1 !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 100px !important;
        padding: 0 10px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
}

/* Trust Badges - Vertical List */
.product-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 2rem;
    padding: 0;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.4;
}

.trust-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--color-text);
}

.trust-link {
    color: var(--color-orange);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.trust-link:hover {
    color: var(--color-hover);
}

.trust-item strong {
    font-weight: 600;
}

.sku-item {
    color: var(--color-text);
}

.product-tags {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.product-tags .tag-cloud {
    justify-content: flex-start;
}



.sku-item svg {
    opacity: 1;
}


/* ── NEW PRODUCT CONTENT SECTION ───────────────── */
.product-main-content-section {
    width: 95%;
    max-width: 1920px;
    margin: clamp(3rem, 6vw, 3rem) auto;
    padding: clamp(2rem, 4vw, var(--container-pad));
    background-color: #F8F6F2;
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(40px, 6vw, 80px);
    align-items: flex-start;
}

.product-main-content-section.no-svg {
    justify-content: center;
}

.product-main-content-section.no-svg .content-left {
    max-width: 100%;
    flex: 1;
}

.product-main-content-section.no-svg .p-info-block.teaser {
    max-width: 75%;
}

.product-main-content-section.no-svg .p-info-block:not(.teaser) {
    max-width: 50%;
}

@media (max-width: 1024px) {
    .product-main-content-section.no-svg .p-info-block.teaser,
    .product-main-content-section.no-svg .p-info-block:not(.teaser) {
        max-width: 100%;
    }
}

.content-left {
    flex: 1 1 400px;
}

.content-right {
    flex: 1 1 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-dimensions {
    width: 100%;
    height: auto;
}

/* Info Blocks */
.p-info-block {
    margin-bottom: 2.5rem;
}

.p-info-block.teaser {
    margin-bottom: 2.5rem;
    font-size: clamp(13px, 1.1vw, 0.95rem);
    color: var(--color-navs);
}

.p-info-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-label);
    font-size: clamp(17px, 1.5vw, 20px);
    font-weight: 600;
    font-style: normal;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.p-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-navs);
}

.p-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.p-info-list .product-height-notice {
    margin-left: 1.25rem;
}

.p-info-list li,
.p-info-text,
.p-info-text p,
.fw-300 {
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 300;
    line-height: 1.6;
    color: #444;
}

.fw-500 {
    font-weight: 500;
}

.montage-row {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.montage-row .p-info-block {
    flex: 1 1 200px;
    margin-bottom: 0;
}

.assembly-time {
    margin-top: 10px;
    font-style: normal;
    font-weight: 300;
    font-size: 0.85rem;
    opacity: 1;
}

.download-list li a {
    color: var(--color-navs);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s;
}

.download-list li a:hover {
    color: var(--color-orange);
}

/* Removed redundant @media wrapper for main content */

@media (max-width: 768px) {
    .p-info-block {
        margin-bottom: 1.75rem;
    }

    .montage-row {
        gap: 20px;
        margin-bottom: 1.75rem;
    }
}


/* Upsell */
.section-upsell {
    padding: clamp(2rem, 5vw, 5rem) 0;
    background-color: #FDFDFD;
}

.section-upsell .section__heading {
    text-align: left;
    margin-bottom: 3rem;
    font-family: var(--font-label);
    font-weight: 500;
    font-size: clamp(20px, 3.5vw, 24px);
}

.section-upsell .products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}
/* Global features na stronie produktu — zmniejszone odstępy */
.single-product .global-features,
.single-product .product-page .global-features {
    margin: 1rem 0 !important;
    padding-block: calc(var(--spacing-section-md) / 2) !important;
}

@media (max-width: 768px) {
    .single-product .global-features,
    .single-product .product-page .global-features {
        margin: 0 !important;
    }
}

/* p-info-block — wcięcie dla wszystkich pól w sekcji */
.p-info-block p,
.p-info-block li {
    padding-left: 1.25em;
    margin-bottom: 0;
}
