/* ═══════════════════════════════════════════════════════════
   Kit Builder — kit.css
   Mobile-first responsive styles for the kit-builder page.
   Desktop sidebar is handled by kit-outer-grid in kit.phtml.
   ═══════════════════════════════════════════════════════════ */

/* ── Product cards grid: 1 col mobile → 2 col tablet+ ───── */
.kit-product-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.kit-product-image-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.kit-product-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── Mobile bar (fixed bottom, hidden on desktop) ───────── */
.kit-mobile-bar {
    display: none;          /* hidden by default (desktop) */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: #fff;
    border-top: 1px solid #E5E7EB;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.10);
}
.kit-mobile-bar-inner {
    max-width: 100%;
    padding: 0.625rem 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Summary row — always visible, tappable */
.kit-mobile-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
    user-select: none;
}
.kit-mobile-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    flex-shrink: 0;
}
.kit-mobile-count {
    font-size: 0.75rem;
    color: #6B7280;
    flex-shrink: 0;
}
.kit-mobile-total {
    font-size: 0.875rem;
    color: #111827;
    margin-left: auto;
    flex-shrink: 0;
}
.kit-mobile-chevron {
    font-size: 0.625rem;
    color: #6B7280;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

/* Expandable drawer */
.kit-mobile-drawer {
    background: #F9FAFB;
    border-radius: 0.75rem;
    padding: 0.75rem;
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.kit-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.kit-mobile-drawer-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}
.kit-mobile-drawer-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #6B7280;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.kit-mobile-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #E5E7EB;
}
.kit-mobile-item:last-child {
    border-bottom: none;
}

/* Progress bar */
.kit-mobile-progress {
    height: 0.375rem;
    background: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.25rem;
}
.kit-mobile-progress-bar {
    height: 100%;
    background: #1DA3DD;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Primary action button */
.kit-mobile-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    background: #1DA3DD;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: opacity 0.2s;
    text-align: center;
}
.kit-mobile-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.kit-mobile-btn:not(:disabled):active {
    opacity: 0.85;
}

/* Outline buttons (Quote / PDF) */
.kit-quote-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #1DA3DD;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid #1DA3DD;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
}
.kit-quote-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.kit-quote-btn:not(:disabled):active {
    background: #EFF9FF;
}

/* "See your product" link-style button */
.kit-mobile-see-btn {
    width: 100%;
    background: none;
    border: none;
    color: #1DA3DD;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    padding: 0.25rem 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Toast notification ──────────────────────────────────── */
.kit-toast {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #111827;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: 0.625rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}
.kit-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #1DA3DD;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.kit-toast-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Mobile: show the bottom bar, hide desktop sidebar */
@media (max-width: 1023px) {
    .kit-mobile-bar {
        display: block;
    }
    /* push page content above the bar so it isn't hidden behind it */
    .kit-outer-wrap {
        padding-bottom: 9rem;
    }
    /* single-column product grid on mobile */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Small phones: tighten bar inner padding */
@media (max-width: 374px) {
    .kit-mobile-bar-inner {
        padding: 0.5rem 0.75rem 0.625rem;
    }
    .kit-mobile-btn,
    .kit-quote-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Tablet (768–1023px): 2-col product grid is fine */
@media (min-width: 768px) and (max-width: 1023px) {
    .grid.grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop (1024px+): hide mobile bar, show sidebar */
@media (min-width: 1024px) {
    .kit-mobile-bar {
        display: none !important;
    }
    .kit-outer-wrap {
        padding-bottom: 1.5rem;
    }
}