/**
 * StrefaWygodywSzprotawie
 * Frontend Styles: Corner Switcher, Fabric Notice & Dimensions Tab
 *
 * @package StrefaWygodywSzprotawie
 * @author Janiewiczs.com
 * @version 1.2.5
 */

/* ==========================================================================
   1. Switcher Component Styles (Luxury Furniture Aesthetic)
   ========================================================================== */

.strefa-corner-switcher,
.corner-orientation-switcher {
    display: block;
    margin: 1.25rem 0;
    padding: 0;
    font-family: inherit;
    box-sizing: border-box;
}

.strefa-corner-switcher *,
.strefa-corner-switcher *::before,
.strefa-corner-switcher *::after,
.corner-orientation-switcher *,
.corner-orientation-switcher *::before,
.corner-orientation-switcher *::after {
    box-sizing: border-box;
}

.strefa-corner-switcher__label,
.corner-orientation-switcher__label {
    display: block;
    font-size: 0.925rem;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.strefa-corner-switcher__options,
.corner-orientation-switcher__options {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Base button / tile styling */
.strefa-corner-switcher__btn,
.corner-orientation-switcher__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    min-height: 44px;
    background-color: #ffffff;
    color: #2c2c2c;
    border: 1px solid #dcd8d0;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Hover & Focus state */
.strefa-corner-switcher__btn:hover,
.corner-orientation-switcher__btn:hover {
    border-color: #825F35;
    background-color: #faf8f5;
    color: #825F35;
}

.strefa-corner-switcher__btn:focus-visible,
.corner-orientation-switcher__btn:focus-visible {
    border-color: #825F35;
    outline: 2px solid rgba(130, 95, 53, 0.35);
    outline-offset: 2px;
}

/* Active / Selected state */
.strefa-corner-switcher__btn.active,
.corner-orientation-switcher__btn.active {
    background-color: #825F35;
    border-color: #825F35;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(130, 95, 53, 0.22);
}

.strefa-corner-switcher__btn.active:hover,
.corner-orientation-switcher__btn.active:hover {
    background-color: #72522c;
    border-color: #72522c;
    color: #ffffff;
}

/* Sofa Layout Vector Icon */
.strefa-corner-switcher__icon,
.corner-orientation-switcher__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.strefa-corner-switcher__icon svg,
.corner-orientation-switcher__icon svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
    fill: none;
    transition: stroke 0.25s ease;
}

.strefa-corner-switcher__text,
.corner-orientation-switcher__text {
    display: inline-block;
    letter-spacing: 0.01em;
}


/* ==========================================================================
   2. Fabric Notice Box (Informacja o dostępnych tkaninach i wzornikach)
   ========================================================================== */

.corner-fabric-notice,
.strefa-fabric-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 18px 0 12px 0;
    padding: 14px 18px;
    background-color: #fcfbfa;
    border: 1px solid #e8e3da;
    border-left: 3px solid #825F35;
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.corner-fabric-notice:hover,
.strefa-fabric-notice:hover {
    background-color: #faf7f2;
    border-color: #dfd8cc;
    border-left-color: #72522c;
}

.corner-fabric-notice__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #825F35;
    margin-top: 2px;
}

.corner-fabric-notice__icon svg {
    width: 100%;
    height: 100%;
    display: block;
    stroke: currentColor;
}

.corner-fabric-notice__content {
    flex: 1 1 auto;
}

.corner-fabric-notice__text {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.925rem !important;
    line-height: 1.55 !important;
    color: #383838 !important;
    font-weight: 400 !important;
    letter-spacing: 0.01em;
}

/* Ensure notice under shop attributes table is spaced nicely */
table.woocommerce-product-attributes+.corner-fabric-notice,
table.shop_attributes+.corner-fabric-notice,
table.woocommerce-product-attributes+.strefa-fabric-notice,
table.shop_attributes+.strefa-fabric-notice {
    margin-top: 18px;
}


/* ==========================================================================
   3. Dimensions Tab Styles (.strefa-product-dimensions-wrapper)
   ========================================================================== */

.strefa-product-dimensions-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: center;
    padding: 14px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.strefa-dimensions-media {
    flex: 1 1 320px;
    text-align: center;
    max-width: 100%;
}

.strefa-dimensions-media img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.strefa-dimensions-content {
    flex: 1 1 300px;
    font-size: 14.5px;
    line-height: 1.65;
    color: #444444;
}

.strefa-dimensions-content p {
    margin: 0 0 12px 0;
}

.strefa-dimensions-content p:last-child {
    margin-bottom: 0;
}

.strefa-dimensions-content ul,
.strefa-dimensions-content ol {
    margin: 0 0 16px 20px;
    padding: 0;
}

.strefa-dimensions-content li {
    margin-bottom: 6px;
    color: #444444;
}

.strefa-dimensions-content strong,
.strefa-dimensions-content b {
    color: #222222;
    font-weight: 600;
}

.strefa-dimensions-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 16px 0;
    font-size: 14px;
}

.strefa-dimensions-content table td,
.strefa-dimensions-content table th {
    padding: 8px 12px;
    border: 1px solid #e8e4dc;
    text-align: left;
}

.strefa-dimensions-content table th {
    background-color: #f9f8f6;
    font-weight: 600;
    color: #2c2c2c;
}


/* ==========================================================================
   4. Gallery Mirror / Flip Effect (transform: scaleX(-1))
   ========================================================================== */

/* Smooth transitions for all target gallery images */
.woocommerce-product-gallery__image img,
.woocommerce-product-gallery .flex-control-thumbs img,
.the7-product-gallery img,
.the7-product-gallery .slider-image img,
.dt-product-gallery img,
.elementor-widget-woocommerce-product-images .woocommerce-product-gallery__wrapper img,
.elementor-widget-woocommerce-product-images .flex-control-thumbs img,
.strefa-mirror-target img {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Flipped state: Flip main product images, flexslider thumbs, and zoom images */
.strefa-gallery-flipped .woocommerce-product-gallery__image img,
.strefa-gallery-flipped .flex-control-thumbs img,
.strefa-gallery-flipped .the7-product-gallery img,
.strefa-gallery-flipped .the7-product-gallery .slider-image img,
.strefa-gallery-flipped .dt-product-gallery img,
.strefa-gallery-flipped .woocommerce-product-gallery__wrapper img,
.strefa-gallery-flipped .elementor-widget-woocommerce-product-images .woocommerce-product-gallery__wrapper img,
.strefa-gallery-flipped .elementor-widget-woocommerce-product-images .flex-control-thumbs img,
.strefa-gallery-flipped .zoomImg,
.strefa-gallery-flipped .strefa-mirror-target img,
.corner-gallery-flipped .woocommerce-product-gallery__image img,
.corner-gallery-flipped .flex-control-thumbs img,
.corner-gallery-flipped .the7-product-gallery img,
.corner-gallery-flipped .the7-product-gallery .slider-image img,
.corner-gallery-flipped .dt-product-gallery img,
.corner-gallery-flipped .woocommerce-product-gallery__wrapper img,
.corner-gallery-flipped .elementor-widget-woocommerce-product-images .woocommerce-product-gallery__wrapper img,
.corner-gallery-flipped .elementor-widget-woocommerce-product-images .flex-control-thumbs img,
.corner-gallery-flipped .zoomImg,
.corner-gallery-flipped .strefa-mirror-target img {
    transform: scaleX(-1) !important;
}

/* ==========================================================================
   5. Exclusions & Safety: Protect UI, Arrows, Zoom Icons, Badges
   ========================================================================== */

/* Slider navigation arrows */
.strefa-gallery-flipped .flex-direction-nav,
.strefa-gallery-flipped .flex-direction-nav *,
.strefa-gallery-flipped .owl-nav,
.strefa-gallery-flipped .owl-nav *,
.strefa-gallery-flipped .swiper-button-prev,
.strefa-gallery-flipped .swiper-button-next,
.strefa-gallery-flipped .slick-arrow,
.strefa-gallery-flipped .dt-arrow,
.corner-gallery-flipped .flex-direction-nav,
.corner-gallery-flipped .flex-direction-nav *,
.corner-gallery-flipped .owl-nav,
.corner-gallery-flipped .owl-nav *,
.corner-gallery-flipped .swiper-button-prev,
.corner-gallery-flipped .swiper-button-next,
.corner-gallery-flipped .slick-arrow,
.corner-gallery-flipped .dt-arrow {
    transform: none !important;
}

/* Pagination dots */
.strefa-gallery-flipped .flex-control-paging,
.strefa-gallery-flipped .swiper-pagination,
.strefa-gallery-flipped .owl-dots,
.strefa-gallery-flipped .slick-dots,
.corner-gallery-flipped .flex-control-paging,
.corner-gallery-flipped .swiper-pagination,
.corner-gallery-flipped .owl-dots,
.corner-gallery-flipped .slick-dots {
    transform: none !important;
}

/* WooCommerce Zoom trigger button and PhotoSwipe icons */
.strefa-gallery-flipped .woocommerce-product-gallery__trigger,
.strefa-gallery-flipped .woocommerce-product-gallery__trigger *,
.strefa-gallery-flipped .pswp__ui,
.strefa-gallery-flipped .pswp__ui *,
.corner-gallery-flipped .woocommerce-product-gallery__trigger,
.corner-gallery-flipped .woocommerce-product-gallery__trigger *,
.corner-gallery-flipped .pswp__ui,
.corner-gallery-flipped .pswp__ui * {
    transform: none !important;
}

/* Badges: On Sale, New, Custom Promo Badges */
.strefa-gallery-flipped .onsale,
.strefa-gallery-flipped .product-badges,
.strefa-gallery-flipped .product-badge,
.strefa-gallery-flipped .wc-block-components-product-sale-badge,
.corner-gallery-flipped .onsale,
.corner-gallery-flipped .product-badges,
.corner-gallery-flipped .product-badge,
.corner-gallery-flipped .wc-block-components-product-sale-badge {
    transform: none !important;
}

/* ==========================================================================
   6. Mobile Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .strefa-product-dimensions-wrapper {
        flex-direction: column !important;
        gap: 20px !important;
        align-items: stretch !important;
        padding: 14px 10px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .strefa-dimensions-media,
    .strefa-dimensions-content {
        flex: 1 1 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {

    .strefa-corner-switcher__options,
    .corner-orientation-switcher__options {
        display: flex;
        width: 100%;
    }

    .strefa-corner-switcher__btn,
    .corner-orientation-switcher__btn {
        flex: 1 1 0;
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .corner-fabric-notice,
    .strefa-fabric-notice {
        padding: 12px 14px;
        gap: 10px;
    }

    .corner-fabric-notice__text {
        font-size: 0.88rem !important;
    }
}

/* ==========================================================================
   7. Dynamic Tabs Visibility & Clean-up (The7 & Elementor)
   ========================================================================== */

.strefa-tab-hidden,
.the7-e-tab-title.strefa-tab-hidden,
.the7-e-tab-item-wrapper.strefa-tab-hidden,
.item-divider.strefa-tab-divider-hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    pointer-events: none !important;
}

/* Instant CSS guard for products without attributes to prevent FOUC */
body.strefa-no-product-attributes .woocommerce-tabs .additional_information_tab,
body.strefa-no-product-attributes #tab-additional_information {
    display: none !important;
}

/* ==========================================================================
   8. Admin WooCommerce Settings: Shortcodes Reference Card
   ========================================================================== */

.strefa-settings-shortcodes-card {
    margin: 28px 0 20px 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #dcd8d0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    max-width: 1080px;
    box-sizing: border-box;
}

.strefa-settings-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 20px;
}

.strefa-settings-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #faf6f0;
    color: #825F35;
    flex-shrink: 0;
}

.strefa-settings-card-title {
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #1e1e1e !important;
}

.strefa-settings-card-subtitle {
    margin: 0 !important;
    font-size: 13px;
    color: #646970;
    line-height: 1.4;
}

.strefa-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.strefa-shortcode-item {
    background: #fdfdfd;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.strefa-shortcode-item:hover {
    border-color: #825F35;
    box-shadow: 0 2px 8px rgba(130, 95, 53, 0.08);
}

.strefa-shortcode-tag {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.strefa-shortcode-tag code {
    background: #f0f0f1;
    color: #825F35;
    font-weight: 600;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    user-select: all;
}

.strefa-alias-badge {
    display: inline-block;
    font-size: 11px;
    color: #787c82;
    background: #f6f7f7;
    padding: 2px 6px;
    border-radius: 3px;
}

.strefa-shortcode-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #444444;
    margin: 0 0 12px 0;
    flex-grow: 1;
}

.strefa-shortcode-params {
    background: #ffffff;
    border-top: 1px dashed #e2e4e7;
    padding-top: 10px;
    font-size: 12.5px;
    color: #555555;
}

.strefa-shortcode-params strong {
    color: #2c2c2c;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: block;
    margin-bottom: 6px;
}

.strefa-shortcode-params ul {
    margin: 0;
    padding-left: 18px;
    list-style-type: disc;
}

.strefa-shortcode-params li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.strefa-shortcode-params li code {
    background: #f6f7f7;
    padding: 1px 4px;
    font-size: 11.5px;
    color: #1e1e1e;
}

.strefa-settings-card-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #ebebeb;
    font-size: 12.5px;
    color: #646970;
    line-height: 1.5;
}

.strefa-settings-card-footer p {
    margin: 0;
}

/* ==========================================================================
   9. Swatches & Attributes Grid (Dense Luxury Layout, No-Hover, Lightbox)
   ========================================================================== */

.strefa-the7-swatches-wrapper,
.woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px 10px !important;
    padding: 4px 0 8px 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.strefa-the7-swatches-wrapper > div,
.woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper > div {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 70px !important;
    min-width: 66px !important;
    max-width: 74px !important;
    margin: 0 !important;
    text-align: center !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    transform: none !important;
    transition: none !important;
}

.strefa-the7-swatches-wrapper > div img,
.woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper > div img {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    border: 1px solid #dcdcdc !important;
    background-color: #ffffff !important;
    display: block !important;
    margin: 0 auto !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transform: none !important;
    transition: none !important;
}

/* Bez efektów po najechaniu myszką (brak podskakiwania i zmian cienia) */
.strefa-the7-swatches-wrapper > div:hover img,
.woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper > div:hover img {
    border-color: #dcdcdc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transform: none !important;
}

/* Tkaniny: kursor powiększenia po najechaniu, aby kliknąć w próbkę */
.woocommerce-product-attributes-item--attribute_pa_dostepna-kolorystyka-tkaniny .strefa-the7-swatches-wrapper > div,
tr[class*="pa_dostepna-kolorystyka-tkaniny"] .strefa-the7-swatches-wrapper > div {
    cursor: zoom-in !important;
}

.strefa-the7-swatches-wrapper > div span,
.woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper > div span {
    display: block !important;
    font-size: 10.5px !important;
    color: #444444 !important;
    margin-top: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    line-height: 1.2 !important;
    text-align: center !important;
    letter-spacing: 0.01em !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
    box-sizing: border-box !important;
    white-space: normal !important;
}

/* Mobile responsive layout for swatches */
@media (max-width: 600px) {
    .strefa-the7-swatches-wrapper,
    .woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper {
        gap: 6px 8px !important;
    }

    .strefa-the7-swatches-wrapper > div,
    .woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper > div {
        width: 64px !important;
        min-width: 60px !important;
        max-width: 68px !important;
    }

    .strefa-the7-swatches-wrapper > div img,
    .woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper > div img {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .strefa-the7-swatches-wrapper > div span,
    .woocommerce-product-attributes-item__value .strefa-the7-swatches-wrapper > div span {
        font-size: 10px !important;
        line-height: 1.15 !important;
    }
}

/* Lightbox dla próbek tkanin */
.strefa-fabric-lightbox {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.strefa-fabric-lightbox.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.strefa-fabric-lightbox__backdrop {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    cursor: pointer !important;
}

.strefa-fabric-lightbox__dialog {
    position: relative !important;
    z-index: 2 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    max-width: 92vw !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform: scale(0.94) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.strefa-fabric-lightbox.active .strefa-fabric-lightbox__dialog {
    transform: scale(1) !important;
}

.strefa-fabric-lightbox__close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: rgba(15, 23, 42, 0.6) !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s ease !important;
    z-index: 10 !important;
}

.strefa-fabric-lightbox__close:hover {
    background: rgba(15, 23, 42, 0.9) !important;
}

.strefa-fabric-lightbox__image-wrap {
    padding: 16px !important;
    background: #f8fafc !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-height: 75vh !important;
    overflow: hidden !important;
}

.strefa-fabric-lightbox__image {
    max-width: 100% !important;
    max-height: 68vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    display: block !important;
}

.strefa-fabric-lightbox__footer {
    padding: 12px 20px 14px !important;
    text-align: center !important;
    background: #ffffff !important;
    border-top: 1px solid #f1f5f9 !important;
}

.strefa-fabric-lightbox__title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 0 2px 0 !important;
    font-family: inherit !important;
}

.strefa-fabric-lightbox__subtitle {
    font-size: 12px !important;
    color: #64748b !important;
    margin: 0 !important;
    font-family: inherit !important;
}