/* ── Modal overlay ──────────────────────────────────────────────────────── */

#dyson-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

body.dyson-modal-open {
    overflow: hidden;
}

#dyson-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    cursor: pointer;
}

/* ── Modal box ──────────────────────────────────────────────────────────── */

#dyson-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(660px, calc(100% - 32px));
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
}

#dyson-modal-title {
    margin: 0 0 6px;
    font-size: 1.3rem;
    padding-right: 32px; /* clearance for close btn */
}

.dyson-modal-subtitle {
    margin: 0 0 20px;
    color: #666;
    font-size: .9rem;
}

#dyson-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
}

#dyson-modal-close:hover {
    background: #f0f0f0;
    color: #000;
}

/* ── Breadcrumb nav ──────────────────────────────────────────────────────── */

.dyson-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.dyson-breadcrumb {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.dyson-breadcrumb li {
    display: flex;
    align-items: center;
}

.dyson-breadcrumb li + li::before {
    content: '›';
    margin-right: 4px;
    color: #aaa;
}

.dyson-breadcrumb-btn {
    background: none;
    border: none;
    padding: 2px 4px;
    font-size: .85rem;
    color: #4933D1;
    cursor: pointer;
    border-radius: 3px;
    text-decoration: underline;
}

.dyson-breadcrumb-btn:hover {
    background: #f0eeff;
}

.dyson-breadcrumb-current {
    font-size: .85rem;
    font-weight: 600;
    color: #333;
}

.dyson-btn-text {
    background: none;
    border: none;
    padding: 2px 4px;
    font-size: .82rem;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
}

.dyson-btn-text:hover {
    color: #333;
    text-decoration: underline;
}

/* ── Option buttons ──────────────────────────────────────────────────────── */

.dyson-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

/* #dyson-modal w selektorach: przyciski motywu (Woodmart :is(.btn, button…)) mają tę samą wagę i ładują się później */
#dyson-modal .dyson-option-btn {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .11);
    border-radius: 20px;
    box-shadow: none;
    outline: none;
    color: #222;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    transition: box-shadow .2s ease;
}

#dyson-modal .dyson-option-btn:hover,
#dyson-modal .dyson-option-btn:focus-visible {
    background: #fff;
    border-color: rgba(0, 0, 0, .11);
    color: #222;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
}

.dyson-option-btn:active {
    transform: translateY(0);
}

/* Wariant z obrazkami (root kategorie) */
.dyson-options--images {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

#dyson-modal .dyson-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0 0 14px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .11);
    border-radius: 20px;
    box-shadow: none;
    outline: none;
    color: #222;
    font-size: inherit;
    letter-spacing: normal;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow .2s ease;
}

#dyson-modal .dyson-option-card:hover,
#dyson-modal .dyson-option-card:focus-visible {
    background: #fff;
    border-color: rgba(0, 0, 0, .11);
    color: #222;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
}

#dyson-modal .dyson-option-card__img-wrap {
    background: #fff;
}

/* Podpowiedź pod kafelkami: gdzie szukać numeru modelu */
.dyson-find-model {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    text-align: center;
}

.dyson-find-model__title {
    margin: 0 0 14px;
    font-size: 1.1rem;
}

.dyson-find-model__img {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    margin: 0 auto 18px;
    border: 1px solid rgba(0, 0, 0, .11);
    border-radius: 20px;
}

.dyson-find-model__btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    background: #4933D1;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.3;
    text-decoration: none;
    transition: background .2s ease;
}

.dyson-find-model__btn:hover,
.dyson-find-model__btn:focus-visible {
    background: #3a27b0;
    color: #fff;
}

.dyson-option-card__img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f7fa;
}

.dyson-option-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.dyson-option-card:hover .dyson-option-card__img-wrap img {
    transform: scale(1.05);
}

.dyson-option-card__name {
    font-size: .82rem;
    font-weight: 600;
    color: #222;
    line-height: 1.2;
    padding: 0 8px;
}

/* ── Modal: lista urządzeń ───────────────────────────────────────────────── */

#dyson-devices-grid {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 16px;
}

.dyson-modal-device-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.dyson-modal-device-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, .11);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .15s;
    height: 100%;
}

.dyson-modal-device-card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, .1);
}

.dyson-modal-device-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.dyson-modal-device-link:hover .dyson-device-model {
    color: #4933D1;
}

/* Kwadratowe zdjęcie – takie samo jak w zakładce konta */
.dyson-modal-device-card .dyson-device-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f7fa;
}

.dyson-modal-device-card .dyson-device-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dyson-modal-device-card .dyson-device-info {
    padding: 8px 10px 4px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dyson-modal-device-card .dyson-device-model {
    font-size: .88rem;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

.dyson-modal-device-card .dyson-device-path {
    font-size: .7rem;
    color: #888;
    line-height: 1.3;
}

.dyson-modal-remove-btn {
    margin: 8px 12px 12px;
    align-self: center;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: .78rem !important;
    line-height: 1.2 !important;
    background: #d60000 !important;
    color: #fff !important;
    border-radius: 25px !important;
    padding: 10px 30px !important;
    border-color: #d60000 !important;
    transition: background .15s !important;
}

.dyson-modal-remove-btn::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M9 6V4h6v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.dyson-modal-remove-btn:hover {
    background: #b00000 !important;
    border-color: #b00000 !important;
}

.dyson-modal-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 4px;
    flex-wrap: wrap;
}

.dyson-modal-compat-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 50px;
    border: 1.5px solid #2e7d32;
    background: #f1faf1;
    color: #2e7d32;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.dyson-modal-compat-btn:hover {
    background: #e0f4e0;
    border-color: #1b5e20;
    color: #1b5e20;
}

.dyson-modal-compat-btn .dyson-badge-check {
    width: 18px;
    height: 18px;
    font-size: .7rem;
}

#dyson-modal-close-btn {
    margin-left: auto;
    border-radius: 25px;
}

/* ── Loading spinner ─────────────────────────────────────────────────────── */

.dyson-loading {
    text-align: center;
    color: #888;
    padding: 20px 0;
    font-style: italic;
}

/* ── Success screen ──────────────────────────────────────────────────────── */

#dyson-view-success {
    text-align: center;
    padding: 8px 0;
}

/* Kafelek właśnie dodanego urządzenia */
.dyson-modal-device-grid.dyson-modal-device-grid--single {
    grid-template-columns: minmax(0, 200px);
    justify-content: center;
    margin-bottom: 16px;
    text-align: left;
}

.dyson-success-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    color: #2e7d32;
}

.dyson-success-text .dyson-badge-check {
    width: 20px;
    height: 20px;
    font-size: .75rem;
}

.dyson-success-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.dyson-btn {
    padding: 10px 30px;
    border-radius: 25px;
    border: 2px solid #ccc;
    background: #f7f7f7;
    cursor: pointer;
    font-size: .9rem;
    transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}

.dyson-btn:hover {
    background: #eee;
}

.dyson-btn.dyson-btn-primary {
    background: #4933D1;
    border-color: #4933D1;
    color: #fff;
    border-radius: 25px;
}

.dyson-btn.dyson-btn-primary:hover {
    background: #5c44e8;
    border-color: #5c44e8;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(73, 51, 209, .35);
}

/* ── Product badge ───────────────────────────────────────────────────────── */

/*
 * li.product needs position: relative (most themes do this already).
 * The badge is rendered before the thumbnail in DOM, so with absolute
 * positioning it visually overlays the image (same technique as WC sale badge).
 */
.dyson-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 5px 0 4px;
    padding: 4px 12px 4px 8px;
    border-radius: 50px;
    border: 1.5px solid #2e7d32;
    background: #f1faf1;
    color: #2e7d32;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-decoration: none;
    cursor: pointer;
}

.dyson-badge:hover {
    background: #e0f4e0;
    border-color: #1b5e20;
    color: #1b5e20;
}

.dyson-badge-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2e7d32;
    color: #fff;
    font-size: .65rem;
    font-weight: 900;
    flex-shrink: 0;
    line-height: 1;
}

.dyson-badge.dyson-badge--lg {
    margin: 0;
    padding: 7px 16px 7px 10px;
    font-size: .8rem;
}

.dyson-badge--lg .dyson-badge-check {
    width: 18px;
    height: 18px;
    font-size: .7rem;
}

/* ── Kompatybilność: karta produktu (shortcode) ──────────────────────────── */

.dyson-product-compat {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.dyson-product-compat__devices {
    font-size: .85rem;
    font-weight: 600;
    color: #2e7d32;
}

.dyson-product-compat__list {
    flex: 0 0 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.dyson-product-compat__label {
    font-size: .8rem;
    font-weight: 600;
    color: #333;
}

/* ── Kompatybilność: koszyk, mini-koszyk, zamówienie ─────────────────────── */

.dyson-compat-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    vertical-align: middle;
}

.dyson-compat-item,
.dyson-compat-more {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 50px;
    border: 1px solid #e0e0e0;
    background: #f7f7f7;
    color: #555;
    font-size: .7rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.dyson-compat-item--owned {
    border-color: #2e7d32;
    background: #f1faf1;
    color: #2e7d32;
    font-weight: 700;
}

.dyson-compat-more {
    border-color: #4933D1;
    background: #fff;
    color: #4933D1;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.dyson-compat-more:hover {
    background: #f0eeff;
    color: #4933D1;
}

/* Pozycje ponad limit – widoczne dopiero po kliknięciu "+N" */
.dyson-compat-list:not(.dyson-compat-list--expanded) .dyson-compat-item--extra {
    display: none;
}

/* Lista siedzi w <dl class="variation"> – etykieta nad chipami, bez marginesów akapitu */
dl.variation dd p:has(.dyson-compat-list) {
    margin: 0;
}

/* W mini-koszyku cały wiersz przykrywa link .cart-item-link – lista ma być nad nim, żeby działał tooltip */
.woocommerce-mini-cart .dyson-compat-list {
    position: relative;
    z-index: 2;
}

/* ── Przypomnienie o garażu (koszyk, zamówienie) ─────────────────────────── */

.dyson-garage-reminder {
    display: flex;
    align-items: center;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin: 0;
    padding: 16px 20px;
    border: 2px dashed #d0c8f8;
    border-radius: 16px;
    background: #faf9ff;
}

.dyson-garage-reminder__icon {
    width: 24px;
    height: 24px;
    font-size: .85rem;
    background: #4933D1;
}

.dyson-garage-reminder__text {
    flex: 1 1 240px;
    margin: 0;
    color: #333;
    font-size: .95rem;
    line-height: 1.4;
}

.dyson-garage-reminder__btn {
    text-decoration: none;
    white-space: nowrap;
}

/* ── Rekomendacje akcesoriów (karta produktu, koszyk) ────────────────────── */

.dyson-recs {
    margin: 20px 0 0;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, .11);
    border-radius: 16px;
    background: #fff;
    clear: both;
}

/* Koszyk: blok pod pozycją, w osobnym wierszu tabeli na całą szerokość */
.dyson-recs.dyson-recs--cart-item {
    margin: 12px 0 0;
    text-align: left;
    white-space: normal;
}

tr.dyson-recs-row > td {
    padding: 20px 0 20px;
    border-top: 0;
}

tr.dyson-recs-row > td::before {
    display: none !important;
}

tr.dyson-recs-row .dyson-recs--cart-item {
    margin-top: 0;
}

.dyson-recs__title {
    margin: 0 0 12px;
    font-size: .9rem;
    font-weight: 600;
    color: #333;
}

.dyson-recs__title strong {
    color: #2e7d32;
}

.dyson-recs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.dyson-recs__item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Przycisk "Dodaj do koszyka" pod kafelkiem – zawsze przy dolnej krawędzi, żeby przyciski w wierszu były w jednej linii */
.dyson-recs .dyson-recs__add {
    display: block;
    width: 100%;
    margin: auto 0 0;
    padding: 7px 8px;
    min-height: 0;
    border: 1.5px solid #4933D1;
    border-radius: 25px;
    background: #4933D1;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-transform: none;
    text-decoration: none;
    white-space: normal;
}

.dyson-recs .dyson-recs__add:hover {
    background: #5c44e8;
    border-color: #5c44e8;
    color: #fff;
}

.dyson-recs .dyson-recs__add--options {
    background: #fff;
    color: #4933D1;
}

.dyson-recs .dyson-recs__add--options:hover {
    background: #f0eeff;
    color: #4933D1;
}

.dyson-recs .dyson-recs__add.loading {
    opacity: .6;
    pointer-events: none;
}

.dyson-recs .dyson-recs__add.added {
    background: #2e7d32;
    border-color: #2e7d32;
}

/* WooCommerce dokleja po dodaniu link "Zobacz koszyk" – w małym kafelku jest zbędny */
.dyson-recs .added_to_cart {
    display: none;
}

.dyson-recs__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.dyson-recs__img {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: #f5f7fa;
}

.dyson-recs__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.dyson-recs__link:hover .dyson-recs__img img {
    transform: scale(1.05);
}

.dyson-recs__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.3;
    color: #222;
}

.dyson-recs__link:hover .dyson-recs__name {
    color: #4933D1;
}

.dyson-recs__price {
    font-size: .8rem;
    color: #555;
}

.dyson-recs__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.dyson-recs__more {
    padding: 8px 20px;
    font-size: .8rem;
    font-weight: 700;
    color: #4933D1;
    border-color: #4933D1;
    background: #fff;
    text-decoration: none;
}

.dyson-recs__more:hover {
    background: #f0eeff;
    color: #4933D1;
}

/* ── Filtr listy produktów wg urządzeń z garażu ──────────────────────────── */

/* Kontener filtra w page builderze (ID: filtr-garazowy) znika, gdy filtr nie ma nic do pokazania */
body.dyson-filter--off #filtr-garazowy {
    display: none !important;
}

/* Gość / brak urządzeń: kafelek z przerywaną ramką, zachęta i przycisk */
.dyson-device-filter--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border: 2px dashed #d0c8f8;
    border-radius: 16px;
    background: #faf9ff;
    text-align: center;
}

.dyson-device-filter__cta-text {
    margin: 0;
    color: #555;
    font-size: .85rem;
    line-height: 1.45;
}

.dyson-device-filter__cta-btn {
    text-decoration: none;
}

.dyson-device-filter__title {
    margin: 0 0 12px;
    font-size: .9rem;
    font-weight: 600;
    color: #333;
}

.dyson-device-filter__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dyson-device-filter__item {
    margin: 0;
}

/* Nieaktywne urządzenie jest wyblakłe; aktywne w filtrze – w pełnym kryciu z zielonym znacznikiem */
.dyson-device-filter__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1.5px solid rgba(0, 0, 0, .11);
    border-radius: 14px;
    background: #fff;
    color: #111;
    text-decoration: none;
    opacity: .4;
    transition: opacity .15s, border-color .15s, background .15s;
}

.dyson-device-filter__link:hover {
    opacity: .75;
    color: #111;
}

.dyson-device-filter__link.is-active {
    opacity: 1;
    border-color: #2e7d32;
    background: #f1faf1;
}

.dyson-device-filter__img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: #f5f7fa;
}

.dyson-device-filter__name {
    flex: 1;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.2;
}

.dyson-device-filter__check {
    visibility: hidden;
}

.dyson-device-filter__link.is-active .dyson-device-filter__check {
    visibility: visible;
}

.dyson-device-filter__clear {
    display: inline-block;
    margin-top: 10px;
    font-size: .8rem;
    font-weight: 600;
    color: #4933D1;
    text-decoration: underline;
}

/* ── Popup dla niezalogowanych ───────────────────────────────────────────── */

.dyson-guest-steps {
    margin: 0 0 24px;
    padding-left: 20px;
    color: #333;
    font-size: .95rem;
    line-height: 1.5;
}

.dyson-guest-steps li + li {
    margin-top: 10px;
}

.dyson-modal--guest .dyson-btn {
    text-decoration: none;
}

/* ── My Account: device grid ─────────────────────────────────────────────── */

.dyson-my-devices h3 {
    margin-top: 0;
}

.dyson-device-grid {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.dyson-device-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, .11);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .15s;
    height: 100%;
}

.dyson-device-card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, .1);
}

/* Kwadratowe zdjęcie kategorii */
.dyson-device-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f7fa;
}

.dyson-device-img-wrap img.dyson-device-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Teksty pod zdjęciem */
.dyson-device-info {
    padding: 10px 12px 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dyson-device-model {
    font-size: .95rem;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

.dyson-device-path {
    font-size: .75rem;
    color: #888;
    line-height: 1.3;
}

/* Przycisk Usuń na dole karty */
.dyson-remove-device {
    margin: 8px 12px 12px;
    align-self: center;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: .78rem !important;
    line-height: 1.2 !important;
    background: #d60000 !important;
    color: #fff !important;
    border-radius: 25px !important;
    padding: 10px 30px !important;
    border-color: #d60000 !important;
    transition: background .15s !important;
}

.dyson-remove-device::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M9 6V4h6v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.dyson-remove-device:hover {
    background: #b00000 !important;
    border-color: #b00000 !important;
}

.dyson-add-device-btn {
    margin-bottom: 24px;
    display: inline-block;
}

.dyson-accessories-heading {
    margin-top: 60px;
}

/* Karta urządzenia linkuje do sekcji z jego akcesoriami */
.dyson-device-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.dyson-device-card__link:hover .dyson-device-model {
    color: #4933D1;
}

/* ── My Account: akcesoria pogrupowane wg urządzenia ─────────────────────── */

.dyson-device-section {
    margin-top: 40px;
    scroll-margin-top: 120px; /* zapas na przyklejony header */
}

.dyson-accessories-heading + .dyson-device-section {
    margin-top: 20px;
}

.dyson-device-section__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.15rem;
}

.dyson-device-section__path {
    font-size: .8rem;
    font-weight: 400;
    color: #888;
}

.dyson-no-devices-msg {
    color: #666;
    margin-bottom: 12px;
}

/* ── Shortcode: override kolumn pętli WooCommerce ───────────────────────── */

.dyson-compatible-products.dyson-cols-2 .products { --dyson-cols: 2; }
.dyson-compatible-products.dyson-cols-3 .products { --dyson-cols: 3; }
.dyson-compatible-products.dyson-cols-4 .products { --dyson-cols: 4; }
.dyson-compatible-products.dyson-cols-5 .products { --dyson-cols: 5; }
.dyson-compatible-products.dyson-cols-6 .products { --dyson-cols: 6; }

/* Produkty wyrównane do prawej */
.dyson-compatible-products ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}

/* Nadpisuje liczbę kolumn niezależnie od motywu */
.dyson-compatible-products[class*="dyson-cols-"] ul.products li.product {
    width: calc(100% / var(--dyson-cols) - 2%) !important;
}

/* ── Shortcode: showcase urządzeń użytkownika ───────────────────────────── */

.dyson-devices-showcase {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-end;
}

/* Szerokość itemu = (100% - suma przerw) / liczba kolumn */
.dyson-devices-showcase--cols-1 .dyson-devices-showcase__item { flex: 0 0 100%; max-width: 100%; }
.dyson-devices-showcase--cols-2 .dyson-devices-showcase__item { flex: 0 0 calc(50% - 8px); max-width: calc(50% - 8px); }
.dyson-devices-showcase--cols-3 .dyson-devices-showcase__item { flex: 0 0 calc(33.333% - 11px); max-width: calc(33.333% - 11px); }
.dyson-devices-showcase--cols-4 .dyson-devices-showcase__item { flex: 0 0 calc(25% - 12px); max-width: calc(25% - 12px); }
.dyson-devices-showcase--cols-5 .dyson-devices-showcase__item { flex: 0 0 calc(20% - 13px); max-width: calc(20% - 13px); }
.dyson-devices-showcase--cols-6 .dyson-devices-showcase__item { flex: 0 0 calc(16.666% - 14px); max-width: calc(16.666% - 14px); }

.dyson-devices-showcase__card {
    display: block;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    text-decoration: none;
    background: #f5f7fa;
}

.dyson-devices-showcase__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.dyson-devices-showcase__card:hover .dyson-devices-showcase__img {
    transform: scale(1.06);
}

/* Overlay wysuwa się od dołu */
.dyson-devices-showcase__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 0 16px 18px;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 55%);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}

.dyson-devices-showcase__card:hover .dyson-devices-showcase__overlay {
    opacity: 1;
    transform: translateY(0);
}

.dyson-devices-showcase__name {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

@media (max-width: 900px) {
    .dyson-devices-showcase--cols-5 .dyson-devices-showcase__item,
    .dyson-devices-showcase--cols-6 .dyson-devices-showcase__item {
        flex: 0 0 calc(33.333% - 11px);
        max-width: calc(33.333% - 11px);
    }
}

@media (max-width: 600px) {
    .dyson-devices-showcase .dyson-devices-showcase__item {
        flex: 0 0 calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
    }
}

/* ── Shortcode CTA (brak urządzenia / niezalogowany) ─────────────────────── */

.dyson-shortcode-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 24px;
    border: 2px dashed #d0c8f8;
    border-radius: 16px;
    background: #faf9ff;
    text-align: center;
}

.dyson-shortcode-cta__text {
    margin: 0;
    color: #555;
    font-size: 1rem;
    max-width: 420px;
    line-height: 1.5;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .dyson-device-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .dyson-device-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    #dyson-modal-box {
        padding: 20px 16px;
    }

    .dyson-options {
        grid-template-columns: 1fr 1fr;
    }

    .dyson-device-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dyson-modal-device-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Shortcode [dyson_garaz] ─────────────────────────────────────────────── */

.dyson-garage .dyson-device-grid {
    grid-template-columns: repeat(var(--dyson-garage-cols, 4), 1fr);
    margin-bottom: 0;
}

/* Niskie kafelki: "Usuń" nie zajmuje miejsca pod spodem, tylko pojawia się na zdjęciu po najechaniu */
.dyson-garage .dyson-device-card {
    position: relative;
}

.dyson-garage .dyson-device-info {
    padding: 8px 12px 10px;
    gap: 2px;
}

.dyson-garage .dyson-remove-device {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    margin: 0;
    padding: 7px 14px !important;
    opacity: 0;
    transition: opacity .15s, background .15s !important;
}

.dyson-garage .dyson-device-card:hover .dyson-remove-device,
.dyson-garage .dyson-device-card:focus-within .dyson-remove-device {
    opacity: 1;
}

/* Ekrany dotykowe nie mają najechania – przycisk jest widoczny cały czas */
@media (hover: none) {
    .dyson-garage .dyson-remove-device {
        opacity: 1;
    }
}

/* Kafelek "Dodaj następne urządzenie" – rozciąga się do wysokości kafelków urządzeń w wierszu */
.dyson-device-add {
    display: flex;
    min-height: 160px;
}

.dyson-device-add__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border: 2px dashed #d0c8f8;
    border-radius: 20px;
    background: #faf9ff;
    color: #4933D1;
    text-align: center;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}

.dyson-device-add__link:hover {
    border-color: #4933D1;
    background: #f0eeff;
    color: #4933D1;
}

.dyson-device-add__plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #4933D1;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1;
}

.dyson-device-add__label {
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.3;
}

/* Niezalogowany: w tle wyblakły podgląd garażu, na wierzchu zachęta do logowania */
.dyson-garage--guest {
    position: relative; /* punkt odniesienia dla nakładki z zachętą */
}

.dyson-garage__ghost {
    opacity: .2;
    pointer-events: none;
    user-select: none;
}

.dyson-garage__guest-cta {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
}

.dyson-garage__guest-cta .dyson-shortcode-cta__text {
    color: #222;
    font-weight: 600;
}

@media (max-width: 900px) {
    .dyson-garage .dyson-device-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .dyson-garage .dyson-device-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ── State-based box visibility ──────────────────────────────────────────── *
 *
 * W page builderze (Elementor, Gutenberg) nadaj kontenerowi jedną z klas:
 *   .dyson-box-guest        → niezalogowany, nieznany użytkownik   → "Załóż konto"
 *   .dyson-box-returning    → niezalogowany, był tu wcześniej      → "Zaloguj się"
 *   .dyson-box-no-devices   → zalogowany, brak urządzeń            → "Dodaj urządzenia"
 *   .dyson-box-has-devices  → zalogowany z urządzeniami            → "Zarządzaj urządzeniami"
 *
 * Plugin ustawia klasę stanu na <body> (np. dyson-state--guest).
 * Boks jest widoczny tylko gdy klasa body pasuje; w pozostałych stanach hidden.
 * ─────────────────────────────────────────────────────────────────────────── */

body:not(.dyson-state--guest)       .dyson-box-guest       { display: none !important; }
body:not(.dyson-state--returning)   .dyson-box-returning   { display: none !important; }
body:not(.dyson-state--no-devices)  .dyson-box-no-devices  { display: none !important; }
body:not(.dyson-state--has-devices) .dyson-box-has-devices { display: none !important; }

/* ── Rejestracja: wybór urządzeń (ten sam popup co w sklepie) ───────────── */
.dyson-register-devices {
    margin: 12px 0 24px;
    padding: 18px 20px 20px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 20px;
    background: #f7f7f8;
}

.dyson-register-devices > label {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.dyson-register-devices .dyson-modal-device-card {
    background: #fff;
}

.dyson-register-devices__desc {
    margin: 0 0 12px;
    font-size: .85rem;
    color: #666;
}

.dyson-register-devices .dyson-modal-device-grid {
    margin-bottom: 12px;
}

.dyson-register-devices .dyson-modal-device-link:hover .dyson-device-model {
    color: #111;
}

.dyson-register-devices__add {
    display: inline-block;
    text-decoration: none;
}

@media (max-width: 480px) {
    .dyson-register-devices .dyson-modal-device-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
