/* ── NP Product Page (replaces Elementor) ── */

/* Override Astra flex container that breaks product layout */
.site-content .ast-container {
    display: block !important;
    padding: 0 !important;
}

/* Force visibility — override the loading-state CSS from produkt-template-refactor */
.np-product-page .np-product-gallery,
.np-product-page .np-product-gallery .woocommerce-product-gallery,
.np-product-page .np-product-summary,
.np-product-page .np-product-summary form.cart {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: none !important;
}

.np-product-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Two-column layout: gallery left, summary right */
.np-product-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 48px;
    align-items: flex-start;
    padding: 30px 0 60px;
}

/* ── Gallery ── */
.np-product-gallery {
}
.np-product-gallery .woocommerce-product-gallery {
    opacity: 1 !important;
    width: 100% !important;
    margin: 0 !important;
}
.np-product-gallery .woocommerce-product-gallery__wrapper {
    margin: 0;
}
.np-product-gallery .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px;
    object-fit: contain !important;
    object-position: center center !important;
}
.np-product-gallery .flex-control-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding: 0;
    list-style: none;
}
.np-product-gallery .flex-control-thumbs li {
    flex: 0 0 60px;
}
.np-product-gallery .flex-control-thumbs li img {
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    border: 2px solid transparent;
}
.np-product-gallery .flex-control-thumbs li img.flex-active,
.np-product-gallery .flex-control-thumbs li img:hover {
    opacity: 1;
    border-color: #1a1a1a;
}

/* ── Summary ── */
.np-product-summary {
    padding-top: 40px;
    float: none !important;
    width: 100% !important;
    position: relative;
}
.np-product-summary .product_title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px;
    line-height: 1.2;
}
/* Hide default WC price visually — keep in DOM for pd2-trigger placement */
.np-product-summary > .price {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.np-product-summary .price del {
    color: #999;
    font-weight: 400;
    font-size: 18px;
}
.np-product-summary .price ins {
    text-decoration: none;
}
.np-product-summary .woocommerce-product-details__short-description {
    font-size: 15px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Manufacturer / Brand — italic serif style */
.np-product-summary .np-manufacturer {
    margin: 4px 0 8px !important;
}
.np-product-summary .np-manufacturer-logo {
    width: 80px !important;
    max-width: 80px !important;
}

/* Hide meta and elements we don't need */
.np-product-summary .product_meta {
    display: none;
}
.np-product-summary .single-product-category {
    display: none !important;
}
.np-product-summary .np-social-proof {
    display: none !important;
}
.np-product-summary .qty {
    display: none !important;
}
/* Show all sizes on desktop, toggle only on mobile */
.np-product-summary .np-size-bulk-toggle {
    display: none !important;
}
.np-product-summary .np-size-swatch.np-size-overflow-item {
    display: inline-flex !important;
}
@media (max-width: 900px) {
    .np-product-summary .np-size-bulk-toggle {
        display: inline-flex !important;
    }
    .np-product-summary .np-size-swatch.np-size-overflow-item {
        display: none !important;
    }
}

/* Variations form */
.np-product-summary .variations_form {
    margin-top: 16px;
}
.np-product-summary .variations {
    margin-bottom: 16px;
}
.np-product-summary .single_add_to_cart_button {
    background: #1a1a1a !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 18px 24px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    font-family: inherit;
    letter-spacing: 0.3px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.np-product-summary .single_add_to_cart_button:hover {
    background: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.np-product-summary .single_add_to_cart_button:active {
    transform: translateY(0);
}

/* Add to cart — WooCommerce override */
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce-js div.product form.cart .single_add_to_cart_button,
.np-product-page .np-product-summary .single_add_to_cart_button {
    margin-top: 0px !important;
    margin-bottom: 5px !important;
    transform: translateX(2px);
    padding: 12px 21px !important;
    border: 1px solid #000 !important;
    border-radius: 4px !important;
    width: 100% !important;
    display: block;
    box-sizing: border-box;
    position: relative;
    box-shadow: none !important;
}

/* Size swatches */
.np-size-swatch-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 0px;
    width: 100%;
}
.np-size-swatch {
    -webkit-appearance: none;
    appearance: none;
    width: auto;
    height: auto;
    padding: 14px;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px;
    background: #fff !important;
    color: #1a1a1a !important;
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

/* ── Trust Indicators ── */
.np-trust-indicators {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 0 16px;
    margin-top: 20px;
}
.np-trust-item {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #444;
    padding: 12px 8px;
    background: #f8f8f6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.np-trust-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}
.np-trust-icon svg {
    width: 20px;
    height: 20px;
}

/* ── Social Proof Nudge ── */
.np-social-proof {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0faf0;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: #2d6a2d;
    font-weight: 500;
}
.np-social-proof svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* ── "Les mer" collapse for product description on mobile ── */
@media (max-width: 900px) {
    .np-product-summary .woocommerce-product-details__short-description {
        max-height: 4.5em;
        overflow: hidden;
        position: relative;
        transition: max-height 0.3s ease;
    }
    .np-product-summary .woocommerce-product-details__short-description.is-expanded {
        max-height: 1000px;
    }
    .np-product-summary .woocommerce-product-details__short-description:not(.is-expanded)::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 2em;
        background: linear-gradient(transparent, #fff);
        pointer-events: none;
    }
    .np-readmore-btn {
        display: inline-block;
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
        cursor: pointer;
        padding: 4px 0;
        margin-bottom: 12px;
        background: none;
        border: none;
        font-family: inherit;
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}
@media (min-width: 901px) {
    .np-readmore-btn {
        display: none;
    }
}

/* ── Product Description Enhancements ── */
.custom-desc-under-variations ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.custom-desc-under-variations ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}
.custom-desc-under-variations ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%232d6a2d'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}
.custom-desc-under-variations p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    padding: 10px 12px;
    background: #f8f8f6;
    border-radius: 6px;
    border-left: 3px solid #2d6a2d;
}

/* ── Product description overflow protection ── */
.np-product-summary table,
.custom-desc-under-variations table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Hide WooCommerce Tabs & Upsells (fallback if hook removal doesn't work) ── */
.np-product-page .woocommerce-tabs { display: none !important; }
.np-product-page .up-sells,
.np-product-page .upsells { display: none !important; }
.np-product-page .related.products { display: none !important; }

/* ── Related Products Slider ── */
.np-related-slider {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .np-product-page {
        padding: 0 16px;
    }
    .np-product-layout {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px 0 40px;
    }
    .np-product-gallery {
        position: static;
    }
    .np-related-slider {
        margin-top: 40px;
        padding-top: 30px;
    }
}

@media (max-width: 600px) {
    .np-product-page {
        overflow-x: hidden;
    }
    .np-product-gallery {
        margin: 0 -16px;
        width: calc(100% + 32px);
    }
    .np-product-gallery .woocommerce-product-gallery__image img {
        border-radius: 0;
    }
    .np-product-summary .product_title {
        font-size: 22px;
    }
    .np-product-summary .price {
        font-size: 20px;
    }
    .np-trust-indicators {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .np-trust-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 10px 14px;
        gap: 10px;
    }
    .np-trust-icon {
        width: 24px;
        height: 24px;
    }
    .np-trust-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ── Related products slider: match homepage design ── */
.np-product-page .np-related-slider {
    max-width: none;
    padding: 0;
    margin-top: 0;
    padding-top: 40px;
    border-top: 1px solid #eee;
    margin-bottom: 60px;
}
.np-product-page .np-related-slider .np-slider-img img {
    box-shadow: none !important;
}

/* ── Sticker product: full-width summary, no gallery ── */
.np-product-page:has(.np-sticker-form) {
    max-width: none;
    padding: 0 40px;
}
.np-product-layout:has(.np-sticker-form) {
    grid-template-columns: 1fr;
    max-width: none;
}
.np-product-layout:has(.np-sticker-form) .np-product-gallery {
    display: none;
}
