/* ============================================
   In-Stock Pages — Weatherby
   goya-child/assets/css/in-stock.css
   ============================================ */

/* ── Page Wrapper ── */
.in-stock-page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ── Header ── */
.in-stock-header {
    margin-bottom: 28px;
}

.in-stock-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.in-stock-subtitle {
    font-size: 0.9rem;
    color: #888;
    margin: 0;
}

/* ── Filter Bar ── */
.in-stock-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    padding: 14px 18px;
    background: #f7f7f7;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}

.in-stock-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.in-stock-select {
    height: 38px;
    padding: 0 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
    min-width: 155px;
    appearance: auto;
}

.in-stock-select:focus {
    outline: none;
    border-color: #8b6f3e;
    box-shadow: 0 0 0 2px rgba(139, 111, 62, 0.15);
}

.in-stock-reset {
    height: 38px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid #c0c0c0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.in-stock-reset:hover {
    border-color: #555;
    color: #333;
}

.in-stock-count {
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
}

/* ── Grid ── */
.in-stock-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

/* ── Card ── */
.in-stock-card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.in-stock-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
}

/* ── Image ── */
.in-stock-card__image-wrap {
    position: relative;
    display: block;
    background: #f8f8f8;
    border-bottom: 1px solid #ebebeb;
    overflow: hidden;
    text-decoration: none;
}

.in-stock-card__image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 20px 24px;
    display: block;
    transition: transform 0.3s ease;
}

.in-stock-card__image-wrap:hover .in-stock-card__image {
    transform: scale(1.04);
}

.in-stock-card__no-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 0.85rem;
}

/* ── Badge ── */
.in-stock-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #2e7d32;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 4px;
    pointer-events: none;
}

/* ── Card Body ── */
.in-stock-card__body {
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Card Header ── */
.in-stock-card__header {
    margin-bottom: 14px;
}

.in-stock-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
    color: #1a1a1a;
}

.in-stock-card__price-summary {
    font-size: 0.875rem;
    color: #777;
}

/* ── Variation Table ── */
.in-stock-card__variations {
    border: 1px solid #ebebeb;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.82rem;
    flex:0 0 auto!important;
}

/* Header row — caliber | barrel | price | atc button */
.in-stock-card__variations-header {
    display: grid;
    grid-template-columns: 1.8fr 0.9fr 1fr 100px;
    gap: 8px;
    background: #f4f4f4;
    padding: 7px 10px;
    border-bottom: 1px solid #e4e4e4;
}

.in-stock-card__variations-header span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #666;
    white-space: nowrap;
}

/* Variation rows */
.in-stock-card__variation-row {
    display: grid;
    grid-template-columns: 1.8fr 0.9fr 1fr 100px;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid #f2f2f2;
    transition: background 0.15s ease;
}

.in-stock-card__variation-row:last-child {
    border-bottom: none;
}

.in-stock-card__variation-row:hover {
    background: #fafafa;
}

/* Overflow rows — hidden by default */
.isc-overflow-row {
    display: none;
}

/* Visible state — added by JS one frame after display */
.isc-overflow-row.isc-row-visible {
    display: grid;
}

/* Overflow rows — animated collapse 
.isc-overflow-row {
    display: grid;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
    opacity: 0;
    border-bottom: none !important;
    transition: max-height 0.3s ease,
                opacity 0.25s ease,
                padding-top 0.3s ease,
                padding-bottom 0.3s ease;
}*/

/* When card is expanded — animate open 
.in-stock-card.isc-expanded .isc-overflow-row {
    max-height: 100px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    opacity: 1;
    border-bottom: 1px solid #f2f2f2 !important;
}*/

.in-stock-card.isc-expanded .isc-overflow-row:last-child {
    border-bottom: none !important;
}

/* No barrel modifier — drop barrel column */
.in-stock-card--no-barrel .in-stock-card__variations-header,
.in-stock-card--no-barrel .in-stock-card__variation-row {
    grid-template-columns: 2.4fr 1.2fr 100px;
}

.in-stock-card--no-barrel .in-stock-card__variations-header span:nth-child(2),
.in-stock-card--no-barrel .in-stock-card__var-barrel {
    display: none;
}

/* Cell text styles */
.in-stock-card__var-caliber {
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    font-size: 0.8rem;
}

.in-stock-card__var-barrel {
    color: #777;
    font-size: 0.8rem;
}

.in-stock-card__var-price {
    font-size: 0.82rem;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
}

.in-stock-card__var-price .woocommerce-Price-amount {
    font-size: 0.82rem;
}

/* ── Accordion Toggle ── */
.in-stock-card__toggle {
    display: block;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid #ebebeb;
    padding: 9px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b6f3e;
    cursor: pointer;
    text-align: left;
    letter-spacing: 0.03em;
    transition: background 0.15s ease;
    margin-bottom: 12px;
}

.in-stock-card__toggle:hover {
    background: #fdf8f2;
}

/* ── Buttons ── */
.in-stock-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
    border: none;
}

/* Add to Cart */
.in-stock-card__btn--cart {
    font-size: 0.68rem;
    padding: 0 8px;
    height: 30px;
    width: 100%;
    background: #111111;
    color: #fff;
    border: 1px solid #d6c3a1;
    /*letter-spacing: 0.16em;*/
}

.in-stock-card__btn--cart:hover {
    background: #d6c3a1;
    border-color: #d6c3a1;
    color: #111111;
}

.in-stock-card__btn--cart.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.in-stock-card__btn--cart.is-added {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

/* More Info */
.in-stock-card__btn--details {
    font-size: 0.72rem;
    padding: 0 16px;
    height: 34px;
    background: transparent;
    color: #111111;
    border: 1px solid #111111;
    letter-spacing: 0.16em;
}

.in-stock-card__btn--details:hover {
    background: #111111;
    color: #fff;
    border-color: #111111;
}

/* ── Card Footer ── */
.in-stock-card__footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    margin-top: auto;
}

/* ── Empty / No Results States ── */
.in-stock-no-results,
.in-stock-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 0.95rem;
}

.in-stock-reset-inline {
    background: none;
    border: none;
    color: #8b6f3e;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

/* ── Variation row button — constrain width, don't stretch ── */
.in-stock-card__variation-row .in-stock-card__btn--cart {
    width: auto;
    min-width: 90px;
    max-width: 100px;
    padding: 0 8px;
    height: 30px;
    flex-shrink: 0;
}

/* ── Caliber cell — prevent awkward mid-word wrapping ── */
.in-stock-card__var-caliber {
    word-break: break-word;
    hyphens: auto;
    min-width: 0;
}

/* ── Variation rows — keep vertical alignment centered regardless of text wrap ── */
.in-stock-card__variation-row {
    align-items: center;
    min-height: 44px;
}

/* ── Equal height cards ── */

/* Grid stretches cards to fill row height — this is the key */
.in-stock-grid {
    align-items: stretch;
}

/* Variation table grows to fill available space in card body */
.in-stock-card__variations {
    flex: 1;
}

/* ── Responsive — Tablet ── */
@media ( max-width: 1024px ) {
    .in-stock-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Responsive — Mobile ── */
@media ( max-width: 640px ) {
    .in-stock-grid {
        grid-template-columns: 1fr;
    }

    .in-stock-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .in-stock-filters {
        flex-direction: column;
    }

    .in-stock-select,
    .in-stock-reset {
        width: 100%;
    }
}

/* ── Responsive — Small mobile: hide barrel column ── */
@media ( max-width: 480px ) {

    /* Hide barrel column header and cells */
    .in-stock-card__variations-header span:nth-child(2),
    .in-stock-card__var-barrel {
        display: none;
    }

    /* Standard cards — drop barrel column */
    .in-stock-card__variations-header,
    .in-stock-card__variation-row {
        grid-template-columns: 1.8fr 1fr 90px;
    }

    /* No-barrel cards — already hiding barrel, just tighten columns */
    .in-stock-card--no-barrel .in-stock-card__variations-header,
    .in-stock-card--no-barrel .in-stock-card__variation-row {
        grid-template-columns: 2fr 1fr 90px;
    }

    /* Filter bar stacks vertically */
    .in-stock-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .in-stock-filters {
        flex-direction: column;
    }

    .in-stock-select,
    .in-stock-reset {
        width: 100%;
    }
}

/* ── Mobile Filter Panel ── */
@media ( max-width: 768px ) {

    .in-stock-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        background: transparent;
        border: none;
        gap: 0;
    }

    .in-stock-filter-bar__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
    }

    .in-stock-filter-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 38px;
        padding: 0 16px;
        background: #1a1a1a;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        cursor: pointer;
    }

    .in-stock-filter-toggle__arrow {
        transition: transform 0.2s ease;
        display: inline-block;
    }

    .in-stock-filter-bar.is-open .in-stock-filter-toggle__arrow {
        transform: rotate(180deg);
    }

    .in-stock-filters {
        display: none;
        flex-direction: column;
        gap: 8px;
        padding: 12px 0 4px;
        border-top: 1px solid #e8e8e8;
        margin-top: 4px;
    }

    .in-stock-filter-bar.is-open .in-stock-filters {
        display: flex;
    }

    .in-stock-select,
    .in-stock-reset {
        width: 100%;
        min-width: unset;
    }

    .in-stock-count {
        font-size: 0.85rem;
    }
}

/* Show toggle button only on mobile — hide on desktop */
@media ( min-width: 769px ) {
    .in-stock-filter-toggle {
        display: none;
    }

    /* On desktop, always show filters */
    .in-stock-filters {
        display: flex !important;
    }
}