/* ============================================================
   GLOBAL FIXES v6 — precyzyjne poprawki bazowane na DOM
   ============================================================ */

/* MAX WIDTH */
.ds-header__inner,.ds-footer__inner,.ds-hp-wrap,.ds-sp-wrap,.ds-archive-wrap {
    max-width: 1920px !important; margin-left: auto !important; margin-right: auto !important;
}

/* ============================================================
   FIBOSEARCH — DOM: sf-wrapp > input + preloader + voice + button
   Klasa pirx układa elementy inaczej — wymuszamy flex row
   ============================================================ */
.ds-header__search .dgwt-wcas-search-wrapp,
.ds-header__search .dgwt-wcas-search-form { width: 100% !important; max-width: 100% !important; }

/* Wrapper — flex row, input po lewej, button po prawej */
.ds-header__search .dgwt-wcas-sf-wrapp {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100% !important;
    position: relative !important;
    flex-wrap: nowrap !important;
}

/* INPUT — zajmuje całą wolną przestrzeń */
.ds-header__search input.dgwt-wcas-search-input,
.ds-header__search .dgwt-wcas-sf-wrapp input[type="search"] {
    flex: 1 1 auto !important;
    order: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 46px !important;
    padding: 0 48px 0 18px !important; /* miejsce na preloader po prawej */
    border: 2px solid #ddd !important;
    border-right: none !important;
    border-radius: 24px 0 0 24px !important;
    font-size: 14px !important;
    font-family: 'Inter', sans-serif !important;
    outline: none !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    position: relative !important;
    z-index: 1 !important;
}
.ds-header__search input.dgwt-wcas-search-input:focus { border-color: #FF5A00 !important; }

/* PRELOADER — absolutnie nad inputem, po prawej */
.ds-header__search .dgwt-wcas-preloader {
    position: absolute !important;
    right: 58px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: auto !important;
    order: 2 !important;
    z-index: 3 !important;
    pointer-events: none !important;
    width: 20px !important;
    height: 20px !important;
    flex: none !important;
}

/* VOICE SEARCH — ukryj jeśli obecny */
.ds-header__search .dgwt-wcas-voice-search {
    display: none !important;
    order: 3 !important;
}

/* SUBMIT BUTTON — po prawej, nieprzeskalowany */
.ds-header__search button.dgwt-wcas-search-submit,
.ds-header__search .dgwt-wcas-sf-wrapp > button,
.ds-header__search .dgwt-wcas-search-submit {
    flex: 0 0 50px !important;
    order: 4 !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 46px !important;
    background: #FF5A00 !important;
    color: #fff !important;
    border: none !important;
    border-left: none !important;
    border-radius: 0 24px 24px 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 1 !important;
    transition: background .15s !important;
}
.ds-header__search .dgwt-wcas-search-submit:hover { background: #e04e00 !important; }

/* SVG ikona w przycisku */
.ds-header__search .dgwt-wcas-search-submit svg,
.ds-header__search .dgwt-wcas-search-submit svg.dgwt-wcas-ico-magnifier {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    flex-shrink: 0 !important;
}
.ds-header__search .dgwt-wcas-search-submit svg path,
.ds-header__search .dgwt-wcas-search-submit svg * { fill: #fff !important; }

/* DROPDOWN wyników */
.dgwt-wcas-suggestions-wrapp { border: 1px solid #ddd !important; border-radius: 0 0 8px 8px !important; box-shadow: 0 6px 20px rgba(0,0,0,.1) !important; z-index: 999 !important; }
.dgwt-wcas-suggestion { padding: 9px 14px !important; font-size: 13px !important; font-family: 'Inter', sans-serif !important; }
.dgwt-wcas-suggestion:hover, .dgwt-wcas-suggestion.selected { background: #fff3ea !important; }
.dgwt-wcas-sp__price { color: #cc2200 !important; font-weight: 700 !important; }

/* ── HAMBURGER ── */
.ds-hamburger { background: #FF5A00 !important; border-radius: 8px !important; width: 44px !important; height: 44px !important; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: none; cursor: pointer; padding: 0; }
.ds-hamburger:hover { background: #e04e00 !important; }
.ds-hamburger span { display: block; height: 2px; width: 22px; background: #fff; border-radius: 2px; }
@media (max-width: 767px) { .ds-hamburger { display: flex !important; } }

/* PRODUCT IMAGES — contain, nie cover */
.ds-product-card__image img,
.ds-carousel__item img,
.woocommerce-loop-product__link img,
.attachment-woocommerce_thumbnail { object-fit: contain !important; padding: 6px !important; background: #fafafa; }

/* ── FIBOSEARCH pirx-compact override
   Plugin CSS: .dgwt-wcas-style-pirx-compact button.dgwt-wcas-search-submit { left:0; top:0; position:absolute }
   Musimy wymusić relative + order ──────────────────────────── */
.ds-header__search .dgwt-wcas-style-pirx.dgwt-wcas-style-pirx-compact .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit,
.ds-header__search .dgwt-wcas-style-pirx-compact .dgwt-wcas-search-submit {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    order: 4 !important;
    flex: 0 0 50px !important;
    width: 50px !important;
    height: 46px !important;
    background: #FF5A00 !important;
    border-radius: 0 24px 24px 0 !important;
    border: none !important;
}

/* ── SEARCH DROPDOWN — wyżej niż header nav ── */
.ds-header__search { position: relative; z-index: 1010 !important; }
.dgwt-wcas-suggestions-wrapp,
.dgwt-wcas-details-wrapp,
.dgwt-wcas-search-wrapp .dgwt-wcas-suggestions-wrapp {
    z-index: 99999 !important;
    position: absolute !important;
}
/* Stacking context for search wrapper */
.ds-header__main .ds-header__inner { isolation: isolate; }
.ds-header__search .dgwt-wcas-search-wrapp { z-index: 1010 !important; position: relative !important; }

/* ============================================================
   CAROUSEL CORE — ładowane na KAŻDEJ stronie
   (homepage.css ładuje się tylko na stronie głównej)
   ============================================================ */

.ds-carousel { position: relative; padding: 0 28px; }

.ds-carousel__track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.ds-carousel__track::-webkit-scrollbar { display: none; }

.ds-carousel__item {
    flex: 0 0 200px;
    min-width: 0;
    scroll-snap-align: start;
}

/* ARROW BUTTONS — zawsze widoczne */
.ds-carousel__btn {
    position: absolute !important;
    top: 40% !important;
    transform: translateY(-50%) !important;
    z-index: 3 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.12) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #333 !important;
    transition: all .15s !important;
    padding: 0 !important;
}
.ds-carousel__btn:hover { background: #FF5A00 !important; border-color: #FF5A00 !important; color: #fff !important; }
.ds-carousel__btn--prev { left: 0 !important; }
.ds-carousel__btn--next { right: 0 !important; }
.ds-carousel__btn svg { pointer-events: none; }

/* PRODUCT CARD core — everywhere */
.ds-product-card { display: flex !important; flex-direction: column !important; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; transition: border-color .15s, box-shadow .15s; height: 100%; }
.ds-product-card:hover { border-color: #bbb; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.ds-product-card__link { display: flex !important; flex-direction: column !important; flex: 1; text-decoration: none; color: inherit; }
.ds-product-card__image { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #fafafa; }
.ds-product-card__image img { width: 100% !important; height: 100% !important; object-fit: contain !important; padding: 6px !important; display: block !important; }
.ds-badge--sale { position: absolute; top: 8px; left: 0; background: #00813a; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 0 3px 3px 0; z-index: 2; pointer-events: none; }
.ds-product-card__body { flex: 1; padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 3px; }
.ds-product-card__title { font-size: 12px; font-weight: 500; color: #111; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 30px; }
.ds-product-card:hover .ds-product-card__title { color: #FF5A00; }
.ds-product-card__price ins,
.ds-product-card__price ins .woocommerce-Price-amount,
.ds-product-card__price .woocommerce-Price-amount { font-size: 15px !important; font-weight: 700 !important; color: #111 !important; text-decoration: none !important; display: block !important; }
.ds-product-card__price del { font-size: 11px; color: #999; display: block; }
.ds-product-card__price .price { font-size: 15px; font-weight: 700; color: #111; }
.ds-product-card__delivery { font-size: 11px; color: #555; }
.ds-product-card__delivery strong { color: #111; }
.ds-product-card__footer { padding: 6px 8px 8px; margin-top: auto; }
.ds-btn--cart { display: block; width: 100%; padding: 8px; background: #fff; color: #FF5A00 !important; border: 1.5px solid #FF5A00; border-radius: 4px; font-size: 11px; font-weight: 700; text-align: center; text-decoration: none !important; cursor: pointer; transition: background .15s; font-family: 'Inter', sans-serif; box-sizing: border-box; }
.ds-btn--cart:hover { background: #FF5A00 !important; color: #fff !important; }

/* Section header */
.ds-section { display: flex; flex-direction: column; gap: 10px; }
.ds-section__header { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 10px; border-bottom: 2px solid #e5e5e5; }
.ds-section__title { font-size: 20px !important; font-weight: 700; color: #111; margin: 0; }
.ds-section__more { font-size: 13px; color: #FF5A00; text-decoration: none; font-weight: 500; }

/* Mobile */
@media (max-width: 767px) {
    .ds-carousel { padding: 0 6px; }
    .ds-carousel__btn {
        width: 28px !important;
        height: 28px !important;
        display: flex !important; /* pokaż na mobile */
    }
    .ds-carousel__btn--prev { left: -2px !important; }
    .ds-carousel__btn--next { right: -2px !important; }
}
