/* === SiMSET Borrow CSS === */
/* Extends style.css with E-commerce & Booking specific components */

:root {
    /* Design System Overrides */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* --- Catalog Layout (E-commerce Style) --- */
.catalog-ecommerce-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Filter Bar E-Commerce --- */
.filter-bar-ecommerce {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 22, 36, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 12px 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.category-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    padding: 8px 16px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-2);
    font-size: 0.9rem;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--tr);
}

.cat-pill:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.cat-pill.active {
    background: rgba(37, 117, 184, 0.15);
    border-color: rgba(37, 117, 184, 0.4);
    color: var(--blue-light);
    font-weight: 600;
}

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.date-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
}

/* --- Quick Detail Drawer Layout --- */
#quick-detail-drawer {
    width: 450px !important;
    max-width: 100vw;
}

@media (max-width: 500px) {
    #quick-detail-drawer {
        width: 100vw !important;
    }
}

.drawer-buy-box {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.mini-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 10px;
}

.mc-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.mc-day.avail-0 {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.mc-day.avail-low {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.mc-day.avail-high {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.mc-date {
    font-weight: 600;
    font-size: 0.85rem;
}

.mc-qty {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Minimalist Card Overrides for E-Commerce */
.product-card {
    min-height: 160px;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card-controls {
    /* Reverted to show Add to Cart */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

/* Big Add to Cart Button */
.btn-add-cart {
    width: 100%;
    background: rgba(37, 117, 184, 0.15);
    border: 1px solid rgba(37, 117, 184, 0.3);
    color: var(--blue-light);
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--tr);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart:hover:not(:disabled) {
    background: rgba(37, 117, 184, 0.25);
    border-color: rgba(37, 117, 184, 0.5);
    color: #fff;
    transform: translateY(-2px);
}

.btn-add-cart:disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: var(--text-3);
    cursor: not-allowed;
    transform: none;
}

/* Base Form elements overrides */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.05);
    /* Support dark mode */
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 200ms ease;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--color-cta);
    outline: none;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.15);
    /* Focus ring */
}

/* --- Date Picker --- */
.date-picker-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    background: rgba(13, 22, 36, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}

.date-input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2);
}

.date-input-group input[type="date"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
    transition: var(--tr);
}

.date-input-group input[type="date"]:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 2px rgba(37, 117, 184, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #1d9bda, #2575b8);
    color: #fff;
    border: none;
    padding: 13px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--tr);
    box-shadow: 0 4px 12px rgba(37, 117, 184, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 117, 184, 0.4);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-3);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--blue-light);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--tr);
}

.btn-outline:hover {
    background: rgba(37, 117, 184, 0.1);
    color: #fff;
}

/* --- Matrix Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--tr);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform var(--tr);
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--tr);
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.matrix-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.matrix-table th,
.matrix-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.matrix-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    color: var(--text-2);
}

.matrix-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--bg-card);
    z-index: 2;
}

.matrix-table td.avail-0 {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    font-weight: bold;
}

.matrix-table td.avail-low {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.matrix-table td.avail-high {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

/* --- Cart Button & Badge --- */
.cart-icon {
    font-size: 1.5rem;
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: var(--tr);
}

.cart-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    transition: transform var(--tr);
}

.cart-badge.bump {
    transform: scale(1.4);
}

/* --- Equipment Cards with Cart Controls --- */
.product-card-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border);
}

.qty-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    font-size: 1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--tr);
}

.qty-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.qty-btn:disabled {
    color: var(--border);
    cursor: not-allowed;
}

.qty-display {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    color: var(--text);
}

.avail-badge {
    font-size: 0.8rem;
    font-weight: 500;
    color: #4ade80;
}

.avail-badge.out-of-stock {
    color: #ef4444;
}

.stock-info {
    font-size: 0.75rem;
    color: var(--text-3);
    text-align: right;
}

/* --- Next Available Date Note --- */
.next-avail-note {
    font-size: 0.75rem;
    color: #f59e0b;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    display: inline-block;
}

/* --- Cart Drawer Overrides --- */
.cart-drawer {
    width: 450px !important;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 15px;
}

.cart-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.cart-item-info p {
    font-size: 0.8rem;
    color: var(--text-2);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    opacity: 0.7;
    transition: var(--tr);
}

.cart-item-remove:hover {
    opacity: 1;
}

.input-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: var(--tr);
}

.input-field:focus {
    border-color: var(--blue-light);
}

/* Layout overrides for Borrow */
.product-card {
    min-height: 200px;
}

/* ── UX Hint: date selection guide ── */
.date-hint {
    font-size: 0.78rem;
    color: var(--text-3);
    margin: 6px 0 0;
    padding: 6px 10px;
    border-left: 2px solid rgba(37, 117, 184, 0.35);
    line-height: 1.5;
}

/* aria-label */