/* Author: ADSCode.pl */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&family=Montserrat:wght@400;600;700;800;900&display=swap');

.adscode-configurator-wrapper {
    font-family: 'Inter', 'Montserrat', Arial, sans-serif;
    color: #111;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100%;
    flex: 0 0 100%;
    margin: 0 0 25px 0;
    text-align: left;
    box-sizing: border-box;
    display: block;
    clear: both;
}

.adscode-configurator-wrapper * {
    box-sizing: border-box;
}

/* Sekcje i Nagłówki */
.adscode-section {
    border: none;
    padding: 0;
    margin: 0 0 30px 0;
    width: 100%;
    min-width: 100%;
    display: block;
}

.adscode-section-title {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    padding: 0;
    color: #0b101e;
    width: 100%;
    border-bottom: none;
    text-align: left;
    display: block;
    white-space: normal;
}

/* Pola formularza - standardowe */
.adscode-field-group {
    position: relative;
    margin-bottom: 15px;
    width: 100%;
    display: block;
    padding-top: 10px;
}

.adscode-field-group label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #111;
    text-align: left;
}

.adscode-field-group .required {
    color: #d32f2f;
}

/* ==========================================================================
   ADSCode - CUSTOM TOOLTIP (Wskazówki UI/UX)
   ========================================================================== */
.adscode-field-group .help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1px solid #666;
    border-radius: 50%;
    font-size: 9px;
    color: #666;
    margin-left: 5px;
    cursor: help;
}

.adscode-field-group .help-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background-color: #0b101e;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    white-space: normal;
    min-width: 160px;
    max-width: 250px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 999;
    pointer-events: none;
}

.adscode-field-group .help-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-width: 5px;
    border-style: solid;
    border-color: #0b101e transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 999;
    pointer-events: none;
}

.adscode-field-group .help-icon:hover::after,
.adscode-field-group .help-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Custom Select Dropdowns */
.adscode-select-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.adscode-select-wrapper select {
    width: 100%;
    max-width: 100%;
    display: block;
    appearance: none;
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 8px;
    padding: 12px 35px 12px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: box-shadow 0.2s ease;
    text-align: left;
    white-space: normal;
}

.adscode-select-wrapper select:focus {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.adscode-select-wrapper::after {
    content: "↕";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    color: #666;
}

/* Pola tekstowe wstrzykiwane z buildera */
.adscode-text-input {
    width: 100%;
    max-width: 100%;
    display: block;
    text-align: left;
}

/* Swatches Group (Image Selectors) */
.adscode-swatch-group {
    position: relative;
    border: 1px solid #000;
    border-radius: 8px;
    padding: 25px 20px 20px 20px;
    background: #fff;
    width: 100%;
    display: block;
}

/* Badge 'MOST POPULAR UPGRADE' */
.adscode-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background-color: #0b101e;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 2;
}

.adscode-group-header label {
    font-size: 13px;
}

.adscode-group-header .price-add {
    color: #666;
    font-weight: 600;
}

.adscode-group-header .example-link {
    color: #000;
    text-decoration: underline;
    margin-left: 8px;
    font-weight: 700;
}

/* Image Swatches */
.adscode-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    align-items: flex-start;
}

.adscode-swatch {
    width: 124px !important;
    height: 124px !important;
    flex: 0 0 124px !important; 
    border-radius: 8px;
    border: 2px solid transparent;
    padding: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-sizing: border-box !important;
    background: #fff; 
    overflow: hidden; 
}

.adscode-swatch img {
    height: 100% !important;
    object-fit: cover !important; 
    border-radius: 4px !important;
    border: 1px solid #eee !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important; 
    max-height: none !important; 
}

.adscode-swatch:hover {
    border-color: #ccc;
}

.adscode-swatch.active {
    border-color: #000;
}

/* Checkmark dla aktywnego elementu */
.adscode-swatch-check {
    display: none;
    position: absolute;
    top: -6px;
    right: -6px;
    background: #000;
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: bold;
    border: 2px solid #fff;
    z-index: 2;
}

.adscode-swatch.active .adscode-swatch-check {
    display: block;
}

/* Wybrana Nazwa Wariantu (Nowość) */
.adscode-swatch-selected-name {
    margin-top: 15px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
    width: 100%;
}

.adscode-swatch-selected-name strong {
    color: #111;
    font-weight: 800;
    text-transform: uppercase;
}

/* Cena */
.adscode-total-price-wrapper {
    font-size: 20px;
    font-weight: 800;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    text-align: right;
    width: 100%;
    display: block;
    white-space: nowrap; 
}

/* ==========================================================================
   ADSCode - Integracja i Naprawa Formularza WooCommerce (Grid/Flexbox)
   ========================================================================== */

.woocommerce div.product form.cart {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

.woocommerce div.product form.cart::before,
.woocommerce div.product form.cart::after {
    display: none !important;
}

.woocommerce div.product form.cart div.quantity {
    flex: 0 0 90px !important; 
    max-width: 90px !important;
    width: 90px !important;
    margin: 0 15px 0 0 !important;
    display: flex !important;
    align-items: center !important;
}

.woocommerce div.product form.cart button.single_add_to_cart_button {
    flex: 1 !important; 
    width: auto !important;
    max-width: calc(100% - 105px) !important;
    margin: 0 !important;
    display: flex !important; 
    justify-content: center !important; 
    align-items: center !important; 
    gap: 12px !important; 
    font-family: 'Inter', 'Montserrat', Arial, sans-serif !important;
    font-weight: 800 !important;
    font-size: 16px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important; 
    padding: 15px 20px !important;
    min-height: 50px !important; 
}

.woocommerce div.product form.cart button.single_add_to_cart_button::before,
.woocommerce div.product form.cart button.single_add_to_cart_button::after,
.woocommerce div.product form.cart button.single_add_to_cart_button i {
    margin: 0 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Custom CSS dla przycisków Radio ADSCode */
.adscode-radio-group input[type="radio"] {
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid #111;
    border-radius: 50%;
    display: inline-grid;
    place-content: center;
    transform: translateY(0.1em);
}

.adscode-radio-group input[type="radio"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #111;
}

.adscode-radio-group input[type="radio"]:checked::before {
    transform: scale(1);
}

/* ==========================================================================
   ADSCode - Dynamiczna Plakietka Ceny Repeatera
   ========================================================================== */
.adscode-repeater-price-badge {
    position: absolute;
    right: 15px; /* Odległość od prawej krawędzi inputa */
    top: 50%;
    transform: translateY(-50%);
    background-color: #0b101e; /* Głęboka czerń pasująca do Twojego brandingu */
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 6px;
    pointer-events: none; /* Pozwala kliknąć "przez" plakietkę, by zacząć pisać */
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 2;
}

/* ==========================================================================
   ADSCode - Lista Rozwijana z Grafikami (Image Select)
   ========================================================================== */
.adscode-image-select-wrapper {
    position: relative;
    width: 100%;
    margin-top: 5px;
}

.adscode-is-trigger {
    border: 1px solid #000;
    border-radius: 8px;
    padding: 12px 15px;
    background: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    font-weight: 600;
    user-select: none;
    transition: box-shadow 0.2s;
}

.adscode-is-trigger:hover {
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.adscode-is-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #000;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 999;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.adscode-is-dropdown.active {
    display: block;
}

.adscode-is-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.adscode-is-option:hover, .adscode-is-option.selected {
    background: #f9f9f9;
}

.adscode-is-option:last-child {
    border-bottom: none;
}

.adscode-is-image {
    width: 150px; /* Szerokość dostosowana do screena */
    height: 110px;
    flex-shrink: 0;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 4px;
    overflow: hidden;
}

.adscode-is-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.adscode-is-image.adscode-no-image {
    display: none; /* Jeśli w edytorze nie wrzucisz linku do zdjęcia, pole zniknie */
}

.adscode-is-details {
    flex: 1;
}

.adscode-is-label {
    font-weight: 500;
    font-size: 14px;
    color: #111;
}

.adscode-is-price {
    font-size: 13px;
    color: #555;
    margin-left: 5px;
}

/* ==========================================================================
   ADSCode - Ekskluzywna Karta ON/OFF (Klon ze screena)
   ========================================================================== */
.adscode-field-type-toggle-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: #fbfbfc; /* Delikatna szarość jak na screenie */
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.adscode-toggle-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.adscode-toggle-header-row strong {
    font-size: 15px;
    color: #111;
    font-weight: 700;
}

.adscode-badge-recommended {
    background-color: #d1f5d3; /* Jasnozielone tło */
    color: #0f6813; /* Ciemnozielony tekst */
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px; /* Okrągły badge */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.adscode-toggle-header-price {
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

.adscode-toggle-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    user-select: none;
}

.adscode-yes-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.adscode-toggle-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-top: 4px;
}

/* Właściwy mechanizm wizualny suwaka imitujący iOS / podany projekt */
.adscode-toggle-switch-img {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.adscode-toggle-switch-img input {
    opacity: 0;
    width: 0;
    height: 0;
}

.adscode-slider-img {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #f6f6f6;
    border: 1px solid #dcdcdc; /* Wyraźna obwódka przy wyłączonym */
    transition: .3s ease-in-out;
    border-radius: 26px;
}

.adscode-slider-img:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 1px;
    bottom: 1px;
    background-color: white;
    border: 1px solid #ccc;
    transition: .3s ease-in-out;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.adscode-toggle-switch-img input:checked + .adscode-slider-img {
    background-color: #1a56db; /* Intensywny niebieski ze screena */
    border-color: #1a56db;
}

.adscode-toggle-switch-img input:checked + .adscode-slider-img:before {
    transform: translateX(22px);
    border-color: white;
}

/* ==========================================================================
   ADSCode - Edukacyjne Okna Modal (Popup)
   ========================================================================== */
.adscode-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    z-index: 999999; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.adscode-modal-overlay.active { opacity: 1; visibility: visible; }

.adscode-modal-content {
    background: #fff; width: 90%; max-width: 900px; padding: 40px;
    border-radius: 16px; position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
    transform: translateY(20px); transition: transform 0.3s ease;
    max-height: 90vh; overflow-y: auto;
}
.adscode-modal-overlay.active .adscode-modal-content { transform: translateY(0); }

.adscode-modal-close {
    position: absolute; top: 15px; right: 20px; font-size: 30px;
    font-weight: bold; color: #999; cursor: pointer; line-height: 1;
}
.adscode-modal-close:hover { color: #000; }

#adscode-modal-body img { max-width: 100%; height: auto; border-radius: 8px; margin-top: 15px; }
#adscode-modal-body p { font-size: 15px; line-height: 1.6; color: #333; }
#adscode-modal-body h3 { margin-top: 0; color: #111; }

/* Poprawka ułożenia elementów w labelu */
.adscode-label-wrapper {
    min-height: 24px;
}

.adscode-edu-trigger:hover {
    color: #000 !important;
    text-decoration: none !important;
}

/* Styl dla ikony pytajnika (hint), aby nie uciekała */
.help-icon {
    flex-shrink: 0;
    transition: background 0.2s;
}

.help-icon:hover {
    background: #ddd;
}

/* Zapewnienie, że popup jest zawsze nad wszystkim */
.adscode-modal-overlay {
    display: flex !important; /* Wymuszenie flexboxa dla wyśrodkowania */
    pointer-events: none;
}

.adscode-modal-overlay.active {
    pointer-events: auto;
}

/* ==========================================================================
   ADSCode - Wielokrotny Wybór (Multi-Select)
   ========================================================================== */
.adscode-multi-select-wrapper { position: relative; width: 100%; margin-top: 5px; }
.adscode-ms-trigger { border: 1px solid #000; border-radius: 8px; padding: 12px 15px; background: #fff; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: inherit; font-size: 14px; user-select: none; transition: box-shadow 0.2s; }
.adscode-ms-trigger:hover { box-shadow: 0 0 5px rgba(0,0,0,0.1); }
.adscode-ms-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #000; border-top: none; border-radius: 0 0 8px 8px; z-index: 999; display: none; max-height: 280px; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.adscode-ms-dropdown.active { display: block; }
.adscode-ms-option { transition: background 0.2s; }
.adscode-ms-option:hover { background: #f4f7f9; }
.adscode-ms-option:last-child { border-bottom: none !important; }


/* ==========================================================================
   ADSCode - Wielokrotny Wybór z Grafikami (Multi-Image Select)
   ========================================================================== */
.adscode-multi-image-select-wrapper { position: relative; width: 100%; margin-top: 5px; }
.adscode-mis-trigger { border: 1px solid #000; border-radius: 8px; padding: 12px 15px; background: #fff; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: inherit; font-size: 14px; font-weight: 600; user-select: none; transition: box-shadow 0.2s; }
.adscode-mis-trigger:hover { box-shadow: 0 0 5px rgba(0,0,0,0.1); }
.adscode-mis-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #000; border-top: none; border-radius: 0 0 8px 8px; z-index: 999; display: none; max-height: 400px; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.adscode-mis-dropdown.active { display: block; }
.adscode-mis-option:hover { background: #f9f9f9; }
.adscode-mis-option:last-child { border-bottom: none !important; }

/* ==========================================================================
   ADSCode - Poprawiony Wybór Rozmiaru (Zawsze obok siebie)
   ========================================================================== */
.adscode-size-picker {
    display: flex !important; /* Wymuszamy układ elastyczny */
    flex-direction: row !important; /* Kierunek: poziomy */
    flex-wrap: wrap; /* Pozwalamy na zawijanie tylko gdy brakuje miejsca */
    gap: 10px;
    margin-top: 10px;
    clear: both;
}

.adscode-size-item {
    position: relative;
    z-index: 10;
    display: inline-flex !important; /* Wymuszamy zachowanie wewnątrz linii */
    width: auto !important; /* Blokujemy rozciąganie na 100% szerokości */
    min-width: 50px;
    height: 45px;
    border: 1px solid #000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    background-color: #fff;
    color: #000;
    padding: 0 15px;
    text-transform: uppercase;
    border-radius: 4px;
    box-sizing: border-box; /* Ważne, aby padding nie powiększał kafelka */
}

/* Etykieta nad rozmiarem - wymuszenie widoczności */
.adscode-label-wrapper {
    display: flex !important;
    width: 100%;
    margin-bottom: 12px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ==========================================================================
   ADSCode - Precyzyjne wyrównanie Popupa do prawej
   ========================================================================== */
.adscode-label-wrapper {
    display: flex !important;
    align-items: center !important; /* Środkuje etykietę i link w pionie */
    justify-content: space-between !important;
    width: 100% !important;
    margin-bottom: 10px !important;
}

.adscode-label-wrapper label {
    margin: 0 !important;
    padding-right: 15px; /* Odstęp, by tekst nie dotykał linku na małych ekranach */
}

.adscode-edu-container {
    margin-left: auto !important; /* Wypycha link do prawej krawędzi */
    white-space: nowrap; /* Zapobiega łamaniu tekstu "Jak zmierzyć?" */
    text-align: right;
}

.adscode-edu-trigger {
    font-size: 12px;
    font-weight: 700;
    color: #1a56db;
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}