/**
 * Sample picker — 5a modal + 6a checkout pieces.
 * Token values per design_handoff_naidised (same family as ursum-storefront.css).
 */

/* ------------------------------------------------------------------ *
 * 6a — entry block, NÄIDISED section, budget strip, sample rows
 * ------------------------------------------------------------------ */

.us-samples-entry {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px dashed #C6CCD6;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 14px 0 4px;
}

.us-samples-entry__body {
    flex: 1;
    min-width: 0;
}

.us-samples-entry__title {
    font-size: 13px;
    font-weight: 700;
    color: #141C2B;
    margin-bottom: 8px;
}

.us-samples-entry .us-btn {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.us-samples__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8A94A3;
    margin: 16px 0 8px;
}

.us-samples-strip {
    background: #F8F9FA;
    border: 1px solid #E7E9EC;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.us-samples-strip__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.us-samples-strip__title {
    font-size: 13px;
    font-weight: 600;
    color: #141C2B;
}

.us-samples-strip__edit {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #141C2B;
    text-decoration: underline;
    cursor: pointer;
}

.us-samples-strip__summary {
    font-size: 12px;
    color: #5A6B82;
    margin-top: 8px;
}

.us-samples-strip__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* Two-tone budget bar: free #141C2B, over-budget overflow #8C3B2B. Track a
   clearly visible grey so the unused share reads against white cards too. */
.us-samples-bar {
    display: flex;
    height: 6px;
    border-radius: 999px;
    background: #DEE3EA;
    overflow: hidden;
}

.us-samples-bar--thick {
    height: 8px;
}

.us-samples-bar--slim {
    height: 6px;
    max-width: 320px;
}

.us-samples-bar__free {
    background: #141C2B;
    height: 100%;
}

.us-samples-bar__paid {
    background: #8C3B2B;
    height: 100%;
}

/* Compact sample rows — smaller than product rows (42px thumb, 13px name). */
.us-item--sample .us-item__thumb {
    width: 42px;
    height: 42px;
}

.us-item--sample .us-item__name {
    font-size: 13px;
}

.us-item--sample .us-item__price {
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.us-item--sample .us-item__price s {
    color: #A6ADB8;
}

.ursum-store .us-chip--sample {
    background: #F2EADC;
    color: #8A6A3B;
}

/* ------------------------------------------------------------------ *
 * 5a — modal
 * ------------------------------------------------------------------ */

.us-samples-noscroll {
    overflow: hidden;
}

.us-samples-modal {
    position: fixed;
    inset: 0;
    /* Above Blocksy's side-panel drawer so the picker can open from it. */
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.us-samples-modal[hidden] {
    display: none;
}

.us-samples-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 28, 43, 0.45);
}

.us-samples-modal__dialog {
    position: relative;
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 24px 64px rgba(20, 28, 43, 0.25);
}

.us-samples-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.us-samples-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #141C2B;
    margin: 0;
}

.us-samples-modal__close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #D9DDE2;
    background: #fff;
    color: #141C2B;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.us-samples-modal__budget .us-samples-strip {
    background: #F8F9FA;
    border-color: #E7E9EC;
    border-radius: 14px;
    margin-bottom: 14px;
}

.us-samples-sel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #D9DDE2;
    border-radius: 999px;
    padding: 4px 6px 4px 12px;
    font-size: 12px;
    color: #141C2B;
}

.us-samples-sel__x {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #EEF0F3;
    border: none;
    color: #141C2B;
    font-size: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.us-samples-modal__tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.us-samples-modal__search {
    width: 100%;
    border: 1px solid #D5DAE1;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    color: #141C2B;
}

.us-samples-modal__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.us-samples-chip {
    border: 1px solid #D9DDE2;
    background: #fff;
    color: #141C2B;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
}

.us-samples-chip.is-active {
    background: #141C2B;
    border-color: #141C2B;
    color: #fff;
}

/* Grid — 3 columns desktop, scroll-contained. */
.us-samples-modal__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    overflow-y: auto;
    max-height: 460px;
    padding: 2px;
    flex: 1;
}

.us-samples-modal__loading,
.us-samples-modal__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #7A8494;
    font-size: 13px;
    padding: 32px 0;
}

.us-samples-card {
    border: 1px solid #E7E9EC;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
}

.us-samples-card.is-selected {
    border: 2px solid #141C2B;
    background: #F8FAFC;
    padding: 11px;
}

.us-samples-card__img {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #F8F9FA;
}

.us-samples-card__img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.us-samples-card__name {
    font-size: 13px;
    font-weight: 600;
    color: #141C2B;
}

.us-samples-card__meta {
    font-size: 12px;
    color: #7A8494;
}

.us-samples-card__stepper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.us-samples-step {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #D9DDE2;
    background: #fff;
    color: #141C2B;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.us-samples-step:disabled {
    border-color: #ECEEF1;
    color: #C6CCD6;
    cursor: default;
}

.us-samples-card__qty {
    min-width: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.us-samples-modal__warn {
    background: #FBEFEC;
    border: 1px solid #E4B7AC;
    color: #8C3B2B;
    font-size: 11px;
    border-radius: 10px;
    padding: 8px 12px;
    margin-top: 12px;
}

.us-samples-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* Numbers align in tables/bars. */
.us-samples-strip .us-num,
.us-samples-modal .us-num,
.us-samples-entry .us-num {
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ *
 * Mobile — full-screen sheet, list rows, 34pt touch targets
 * ------------------------------------------------------------------ */

@media (max-width: 640px) {
    .us-samples-modal {
        align-items: stretch;
        justify-content: stretch;
    }

    .us-samples-modal__dialog {
        width: 100vw;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
        padding: 16px;
    }

    .us-samples-modal__grid {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .us-samples-card {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .us-samples-card__img {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    .us-samples-card__name {
        flex: 1;
    }

    .us-samples-card__stepper {
        margin-top: 0;
        margin-left: auto;
    }

    .us-samples-step {
        width: 34px;
        height: 34px;
    }

    .us-samples-modal__chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .us-samples-modal__foot {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 10px;
    }

    .us-samples-modal__foot .us-btn--primary {
        flex: 1;
    }

    .us-samples-entry {
        flex-direction: column;
        align-items: stretch;
    }

    .us-samples-entry .us-btn {
        width: 100%;
    }
}

/* ------------------------------------------------------------------ *
 * Mini-cart drawer strip (Blocksy side panel) — compact budget + trigger
 * ------------------------------------------------------------------ */

.us-minicart-samples {
    border: 1px dashed #C6CCD6;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 12px 0;
    background: #fff;
}

.us-minicart-samples__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.us-minicart-samples__title {
    font-size: 12px;
    font-weight: 600;
    color: #141C2B;
    line-height: 1.35;
}

.us-minicart-samples .us-btn {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    background: #141C2B;
    color: #fff;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
}

.us-minicart-samples .us-num { font-variant-numeric: tabular-nums; }

/* In the drawer the track spans the full strip width (the 320px slim cap
   is a checkout-entry-block detail). */
.us-minicart-samples .us-samples-bar--slim { max-width: none; }

/* Sample group inside the drawer's item list (mini-cart override). Plain
   (unscoped) selectors — the drawer markup sits outside .ursum-store. */
.us-minicart-samples-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8A94A3;
    margin: 14px 0 6px;
}

ul.us-minicart-sample-list {
    border-top: 1px solid #ECEEF1;
    padding-top: 6px;
}

.us-mini-sample-chip {
    display: inline-block;
    background: #F2EADC;
    color: #8A6A3B;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 8px;
    margin: 2px 0;
}

.us-mini-sample-reg {
    display: inline-block;
    font-size: 11px;
    color: #A6ADB8;
    margin-left: 6px;
}

/* ------------------------------------------------------------------ *
 * Drawer item rows — Blocksy's own anatomy, explicit in our template:
 * thumb | body (name, then stepper × price) | remove. The remove link
 * keeps Blocksy's trash-icon styling; we only place it.
 * ------------------------------------------------------------------ */

.widget_shopping_cart_content ul.woocommerce-mini-cart {
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget_shopping_cart_content li.us-mini-item {
    display: flex !important;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid #ECEEF1;
}

.widget_shopping_cart_content .us-mini-item__thumb {
    flex: 0 0 64px;
    display: block;
}

.widget_shopping_cart_content .us-mini-item__thumb img {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 !important;
    background: #F8F9FA;
    display: block;
}

.widget_shopping_cart_content .us-mini-item__body {
    flex: 1 1 auto;
    min-width: 0;
}

.widget_shopping_cart_content .us-mini-item__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #141C2B !important;
    text-decoration: none !important;
    margin-bottom: 6px;
}

/* Stepper × price line under the name (Blocksy's stepper markup rides in
   the quantity filter output — untouched, just laid out). */
.widget_shopping_cart_content .us-mini-item__meta,
.widget_shopping_cart_content .us-mini-item__meta .quantity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #5A6B82;
    font-variant-numeric: tabular-nums;
}

/* Remove link: right edge, vertically centered on the row; Blocksy's own
   trash-icon styling is left alone. */
.widget_shopping_cart_content li.us-mini-item a.remove {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: center;
}

/* Sample extras inside the body: compact chip + struck regular inline. */
.widget_shopping_cart_content .us-mini-sample-chip {
    display: inline-block;
    margin: 0 0 6px;
}

.widget_shopping_cart_content .us-mini-sample-reg {
    margin: 0 0 6px 6px;
}

.widget_shopping_cart_content .us-minicart-samples-label {
    margin: 16px 0 4px;
}

.widget_shopping_cart_content ul.us-minicart-sample-list {
    border-top: 0;
    padding-top: 0;
}

.widget_shopping_cart_content ul.us-minicart-sample-list .us-mini-item__name {
    font-size: 13px;
}

.widget_shopping_cart_content ul.us-minicart-sample-list .us-mini-item__thumb,
.widget_shopping_cart_content ul.us-minicart-sample-list .us-mini-item__thumb img {
    flex-basis: 48px;
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
}

/* Drawer footer buttons — "Vaata ostukorvi" as the secondary pill,
   "Maksma" (checkout) as the primary dark pill, side by side. */
.widget_shopping_cart_content p.buttons {
    display: flex !important;
    gap: 10px;
    margin: 14px 0 0 !important;
}

.widget_shopping_cart_content p.buttons a,
.widget_shopping_cart_content .woocommerce-mini-cart__buttons a {
    flex: 1 1 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px !important;
    border-radius: 999px !important;
    border: 1px solid #D5DAE1 !important;
    background: #fff !important;
    color: #141C2B !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: none !important;
    box-shadow: none !important;
}

.widget_shopping_cart_content p.buttons a.checkout,
.widget_shopping_cart_content .woocommerce-mini-cart__buttons a.checkout,
.widget_shopping_cart_content p.buttons a[href*="tellimuse"],
.widget_shopping_cart_content p.buttons a:last-child {
    background: #141C2B !important;
    border-color: #141C2B !important;
    color: #fff !important;
}

/* Drawer header row: our own OSTUKORV title injected beside the close
   button (Blocksy's ct-panel-heading stays as the theme wants it). */
.ct-panel-actions .us-drawer-title {
    flex: 1 1 auto;
    font-size: 20px;
    font-weight: 700;
    color: #141C2B;
    text-transform: none;
    letter-spacing: 0;
    align-self: center;
}

/* Drawer footer buttons live in Blocksy's panel chrome, outside the WC
   widget wrapper — panel-level selectors. */
.ct-panel .woocommerce-mini-cart__buttons a,
.ct-panel p.buttons a,
#woo-cart-panel .woocommerce-mini-cart__buttons a,
#woo-cart-panel p.buttons a {
    flex: 1 1 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px !important;
    border-radius: 999px !important;
    border: 1px solid #D5DAE1 !important;
    background: #fff !important;
    color: #141C2B !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: none !important;
    box-shadow: none !important;
}

.ct-panel .woocommerce-mini-cart__buttons,
.ct-panel p.buttons,
#woo-cart-panel .woocommerce-mini-cart__buttons,
#woo-cart-panel p.buttons {
    display: flex !important;
    gap: 10px;
}

.ct-panel .woocommerce-mini-cart__buttons a.checkout,
.ct-panel p.buttons a.checkout,
.ct-panel p.buttons a:last-child,
#woo-cart-panel .woocommerce-mini-cart__buttons a.checkout,
#woo-cart-panel p.buttons a:last-child {
    background: #141C2B !important;
    border-color: #141C2B !important;
    color: #fff !important;
}

/* Modal footer buttons — self-contained pill styles so the modal doesn't
   depend on ursum-storefront.css (absent off the storefront pages, where
   the picker opens from the drawer). */
.us-samples-modal__foot .us-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
}

.us-samples-modal__foot .us-btn--secondary {
    background: #fff;
    border: 1px solid #D5DAE1;
    color: #141C2B;
}

.us-samples-modal__foot .us-btn--primary {
    background: #141C2B;
    border: 1px solid #141C2B;
    color: #fff;
}
