/* ================================================================
   Invertek Shop — Frontend CSS
   Matches design: filters left / cards with pills on image
   ================================================================ */

/* ── Loading state ──────────────────────────────────────────── */
.isk-archive__inner {
    position: relative;
    transition: opacity .2s;
}
.isk-archive__inner.isk-loading {
    opacity: .4;
    pointer-events: none;
}
.isk-archive__inner.isk-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.6)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%231565C0' stroke-width='5' stroke-dasharray='31.4 31.4' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.7s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E")
        center / 36px no-repeat;
    z-index: 20;
    border-radius: 8px;
}

/* ── Count bar ──────────────────────────────────────────────── */
.isk-count-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.isk-count-text {
    font-size: 14px;
    color: #374151;
}
.isk-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.isk-sort-label {
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
}
.isk-sort-select {
    font-size: 14px;
    padding: 7px 32px 7px 12px;
    border: 1.5px solid #D1D5DB;
    border-radius: 10px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23374151' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") right 10px center / 12px no-repeat;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    color: #111827;
    min-width: 160px;
}
.isk-sort-select:focus { border-color: #1565C0; }

/* ── Grid ───────────────────────────────────────────────────── */
.isk-grid {
    display: grid;
    grid-template-columns: repeat(var(--isk-cols, 3), 1fr);
    gap: 20px;
}
@media (max-width: 1024px) {
    .isk-grid { grid-template-columns: repeat(var(--isk-cols-t, 2), 1fr); }
}
@media (max-width: 640px) {
    .isk-grid { grid-template-columns: repeat(var(--isk-cols-m, 1), 1fr); }
}

/* ── Card ───────────────────────────────────────────────────── */
.isk-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.isk-archive--shadow .isk-card {
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.isk-archive--shadow .isk-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    transform: translateY(-2px);
}

/* ── Image area (contains badges + image) ───────────────────── */
.isk-card__image-area {
    position: relative;
    background: #F8F9FA;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ── Badges row (cat pill + best-selling) – top-left ────────── */
.isk-card__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
}

/* ── Image link & img ────────────────────────────────────────── */
.isk-card__img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}
.isk-card__img {
    max-width: 100%;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform .25s;
}
.isk-card:hover .isk-card__img { transform: scale(1.04); }

/* ── Pills ───────────────────────────────────────────────────── */
.isk-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: .2px;
}
/* Category pill — blue */
.isk-pill--cat {
    background: #DBEAFE;
    color: #1565C0;
}
/* Best-selling pill — green */
.isk-pill--best {
    background: #16A34A;
    color: #fff;
}
/* Sale pill — red */
.isk-pill--sale {
    background: #DC2626;
    color: #fff;
}
/* Feature tag pills — light blue, in card body */
.isk-pill--tag {
    background: #EFF6FF;
    color: #1D4ED8;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ── Card body ───────────────────────────────────────────────── */
.isk-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 16px 16px;
    gap: 6px;
}

/* ── Title ───────────────────────────────────────────────────── */
.isk-card__title-link { text-decoration: none; }
.isk-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin: 0;
}
.isk-card__title-link:hover .isk-card__title { color: #1565C0; }

/* ── Spec line ───────────────────────────────────────────────── */
.isk-card__spec {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
    line-height: 1.4;
}

/* ── Tag pills row ───────────────────────────────────────────── */
.isk-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

/* ── Footer: price + cart ────────────────────────────────────── */
.isk-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    gap: 8px;
}
.isk-card__price { flex: 1; }
.isk-card__price .price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.isk-card__price .price del {
    font-size: 13px;
    font-weight: 400;
    opacity: .55;
    text-decoration: line-through;
}
.isk-card__price ins { text-decoration: none; }

/* ── Cart button (circle) ────────────────────────────────────── */
.isk-card__cart .add_to_cart_button,
.isk-card__cart .isk-cart-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    border-radius: 50% !important;
    background: #1565C0 !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
    padding: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    font-size: 0 !important;  /* hide text if any */
    transition: opacity .18s, transform .15s;
    box-shadow: 0 4px 12px rgba(21,101,192,.35);
}
.isk-card__cart .add_to_cart_button:hover,
.isk-card__cart .isk-cart-btn:hover {
    opacity: .88;
    transform: scale(1.07);
}
/* Cart icon via pseudo-element */
.isk-card__cart .add_to_cart_button::before,
.isk-card__cart .isk-cart-btn::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM5.1 4H2V2H0v2h2l3.6 7.59L4.25 14c-.16.28-.25.61-.25.96C4 16.1 4.9 17 6 17h14v-2H6.42c-.14 0-.25-.11-.25-.25l.03-.12.72-1.63H17c.75 0 1.41-.41 1.75-1.03L21.7 6H5.1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Hide WC button text */
.isk-card__cart .add_to_cart_button .screen-reader-text,
.isk-card__cart .add_to_cart_button span { display: none !important; }

/* ── No products ─────────────────────────────────────────────── */
.isk-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
    font-size: 15px;
    width: 100%;
    grid-column: 1 / -1;
}

/* ══════════════════════════════════════════════════════════════
   FILTERS PANEL
   ══════════════════════════════════════════════════════════════ */
.isk-filters {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.isk-filters--shadow {
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

.isk-filter-group { display: flex; flex-direction: column; gap: 10px; }

.isk-filter__heading {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

/* Separator between groups */
.isk-filter-group + .isk-filter-group {
    padding-top: 18px;
    border-top: 1px solid #F3F4F6;
}

/* Search */
.isk-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
}
.isk-search-input:focus { border-color: #1565C0; }

/* Checkbox list */
.isk-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.isk-filter-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    line-height: 1.3;
    user-select: none;
}
.isk-filter-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #1565C0;
    border-radius: 3px;
}

/* Price row: ₹Min  ₹Max  [Go] */
.isk-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.isk-price-field {
    display: flex;
    align-items: center;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}
.isk-price-sym {
    padding: 0 6px 0 8px;
    font-size: 13px;
    color: #6B7280;
    background: #F9FAFB;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid #E5E7EB;
    white-space: nowrap;
}
.isk-price-input {
    border: none;
    outline: none;
    padding: 8px 8px;
    font-size: 13px;
    width: 100%;
    min-width: 0;
    background: #fff;
    color: #111827;
    -moz-appearance: textfield;
}
.isk-price-input::-webkit-inner-spin-button,
.isk-price-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.isk-price-go {
    padding: 8px 14px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
    flex-shrink: 0;
}
.isk-price-go:hover { opacity: .82; }

/* ══════════════════════════════════════════════════════════════
   LOAD MORE & PAGINATION
   ══════════════════════════════════════════════════════════════ */
.isk-loadmore-wrap {
    text-align: center;
    margin-top: 32px;
}
.isk-load-more {
    background: none;
    border: none;
    border-bottom: 2px solid #111827;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    padding: 2px 0;
    cursor: pointer;
    transition: opacity .15s;
    letter-spacing: .2px;
}
.isk-load-more:hover { opacity: .65; }

.isk-pages-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 28px;
}
.isk-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1.5px solid #E5E7EB;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #374151;
    transition: background .14s, color .14s, border-color .14s;
}
.isk-page-btn:hover { border-color: #1565C0; color: #1565C0; }
.isk-page-btn--active {
    background: #1565C0 !important;
    color: #fff !important;
    border-color: #1565C0 !important;
}

/* =================================================================
   MOBILE DROPDOWN FILTER
   ================================================================= */
@media (max-width: 768px) {

    /* ── Count bar stacks vertically ── */
    .isk-count-bar { flex-direction: column; align-items: flex-start; }

    /* ── Toggle button (hidden on desktop) ── */
    .isk-filters-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        background: #fff;
        border: 1.5px solid #E5E7EB;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        color: #111827;
        cursor: pointer;
        box-sizing: border-box;
        transition: border-color .15s, border-radius .22s;
    }
    .isk-filters-toggle:focus { outline: none; border-color: #1565C0; }
    .isk-filters--shadow + .isk-filters-toggle,
    .isk-filters-toggle { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

    /* Arrow inside the toggle */
    .isk-filters-toggle__arrow {
        display: block;
        width: 18px;
        height: 18px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
        flex-shrink: 0;
        transition: transform .22s ease;
    }
    .isk-filters-toggle.is-open .isk-filters-toggle__arrow {
        transform: rotate(180deg);
    }

    /* Active filter count badge */
    .isk-filters-toggle__count {
        display: none;
        background: #1565C0;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        padding: 3px 7px;
        border-radius: 99px;
        margin-left: 8px;
    }
    .isk-filters-toggle__count.is-visible { display: inline-flex; align-items: center; }

    .isk-filters-toggle__label {
        display: flex;
        align-items: center;
        flex: 1;
    }

    /* ── Collapsible panel ── */
    .isk-filters {
        overflow: hidden;
        max-height: 0;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        gap: 0;
        border: 1.5px solid #E5E7EB;
        border-top: none;
        border-radius: 0 0 12px 12px;
        box-shadow: none !important;
        transition: max-height .3s ease, padding .25s ease, gap .25s ease;
    }
    .isk-filters.is-open {
        max-height: 2000px;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
        gap: 16px;
    }
    .isk-filters--shadow.is-open {
        box-shadow: 0 4px 20px rgba(0,0,0,.10) !important;
    }

    /* Groups slightly tighter on mobile */
    .isk-filter-group + .isk-filter-group { padding-top: 14px; }
    .isk-price-row { flex-wrap: wrap; }

    /* ── Wrapper: toggle sits above panel, connected visually ── */
    .isk-filters-wrapper {
        display: flex;
        flex-direction: column;
    }
    .isk-filters-toggle.is-open {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom-color: #E5E7EB;
    }
}

/* ── Desktop: toggle hidden, wrapper transparent ── */
@media (min-width: 769px) {
    .isk-filters-toggle  { display: none; }
    .isk-filters-wrapper { display: contents; }
}

/* ── Cart button variants ────────────────────────────────────── */
/* Text only */
.isk-cart-style--text .isk-cart-btn,
.isk-cart-style--text .add_to_cart_button {
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    padding: 9px 18px !important;
    border-radius: 10px !important;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
/* Icon + Text */
.isk-cart-style--icon-text .isk-cart-btn,
.isk-cart-style--icon-text .add_to_cart_button {
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    padding: 9px 16px !important;
    border-radius: 10px !important;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
/* Show WC button text for text/icon-text modes */
.isk-cart-style--text .add_to_cart_button .screen-reader-text,
.isk-cart-style--text .add_to_cart_button span,
.isk-cart-style--icon-text .add_to_cart_button .screen-reader-text,
.isk-cart-style--icon-text .add_to_cart_button span { display: inline !important; }

/* ── No zoom variant ─────────────────────────────────────────── */
.isk-archive--no-zoom .isk-card__img { transform: none !important; }
.isk-archive--no-zoom .isk-card:hover .isk-card__img { transform: none !important; }

/* ══════════════════════════════════════════════════════════════
   AJAX ADD-TO-CART STATES
   ══════════════════════════════════════════════════════════════ */

/* Loading state — spinning ring replaces the cart icon */
.isk-card__cart .add_to_cart_button.isk-adding,
.isk-card__cart .isk-cart-btn.isk-adding {
    pointer-events: none !important;
    opacity: .75 !important;
}
.isk-card__cart .add_to_cart_button.isk-adding::before,
.isk-card__cart .isk-cart-btn.isk-adding::before {
    background-image: none !important;
    border: 3px solid rgba(255,255,255,.35) !important;
    border-top-color: #fff !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    animation: isk-spin .7s linear infinite !important;
}
@keyframes isk-spin {
    to { transform: rotate(360deg); }
}

/* Added state — checkmark replaces the cart icon */
.isk-card__cart .add_to_cart_button.isk-added,
.isk-card__cart .isk-cart-btn.isk-added {
    background: #22c55e !important;
    pointer-events: none !important;
}
.isk-card__cart .add_to_cart_button.isk-added::before,
.isk-card__cart .isk-cart-btn.isk-added::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
    animation: none !important;
    border: none !important;
}

/* Text-style and icon-text button loading/added states */
.isk-cart-style--text .add_to_cart_button.isk-adding,
.isk-cart-style--text .isk-cart-btn.isk-adding,
.isk-cart-style--icon-text .add_to_cart_button.isk-adding,
.isk-cart-style--icon-text .isk-cart-btn.isk-adding {
    pointer-events: none !important;
    opacity: .7 !important;
}
.isk-cart-style--text .add_to_cart_button.isk-added,
.isk-cart-style--text .isk-cart-btn.isk-added,
.isk-cart-style--icon-text .add_to_cart_button.isk-added,
.isk-cart-style--icon-text .isk-cart-btn.isk-added {
    background: #22c55e !important;
    pointer-events: none !important;
}

/* Inline error notice */
.isk-cart-notice {
    font-size: 12px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 3px solid #ef4444;
    background: #fef2f2;
    color: #b91c1c;
}
