/* =========================================================
   Premium Catalog & Product Grid Styles
   ========================================================= */

/* Overrides for the product card */
.product-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-radius: 16px !important;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08) !important;
    border-color: rgba(245, 117, 57, 0.3) !important;
}

/* Image wrapper */
.product-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.product-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrap img {
    transform: scale(1.05);
}

/* Badges */
.p-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sale-badge {
    background: var(--color-accent, #f57539);
    color: white;
}

.out-of-stock {
    background: #475569;
    color: white;
}

.oos .product-img-wrap img {
    opacity: 0.6;
    filter: grayscale(100%);
}

/* Product Info */
.product-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.p-category {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 600;
}

.p-title {
    font-size: 1.05rem;
    line-height: 1.4;
    font-weight: 700;
    margin: 0 0 10px 0;
    flex-grow: 1;
}

.p-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s;
}

.p-title a:hover {
    color: var(--color-accent, #f57539);
}

/* Pricing */
.p-price-box {
    margin-bottom: 15px;
}

.p-price.current {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

.p-price.old {
    font-size: 0.9rem !important;
    color: #94a3b8 !important;
    text-decoration: line-through;
    margin-left: 8px;
}

/* Buttons */
.p-card-actions {
    display: flex;
    gap: 8px;
}

.btn-card-add, .btn-card-buy, .btn-card-simple {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-card-add {
    background: rgba(245, 117, 57, 0.1);
    color: var(--color-accent, #f57539);
}

.btn-card-add:hover {
    background: rgba(245, 117, 57, 0.2);
    transform: translateY(-2px);
}

.btn-card-buy {
    background: #0f172a;
    color: white;
}

.btn-card-buy:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}

.btn-card-simple.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    width: 100%;
}

/* Sticky Sidebar Filter */
.catalog-sidebar {
    position: sticky;
    top: 90px;
    height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 15px;
}
.catalog-sidebar::-webkit-scrollbar {
    width: 4px;
}
.catalog-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.filter-section h4 {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 1rem !important;
    letter-spacing: 0.1em !important;
}

/* Sidebar List Items */
.sidebar-list label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    color: #475569;
}

.sidebar-list label:hover {
    background: rgba(0,0,0,0.03);
    color: #0f172a;
}

.sidebar-list input[type="radio"],
.sidebar-list input[type="checkbox"] {
    accent-color: var(--color-accent, #f57539);
    width: 16px;
    height: 16px;
    margin-right: 12px;
}

/* Toggle Filter (Stock) */
.toggle-filter {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}
.toggle-filter:hover {
    background: rgba(0,0,0,0.03);
}

.toggle-track {
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-filter.active .toggle-track {
    background: var(--color-accent, #f57539);
}

.toggle-filter.active .toggle-track::after {
    transform: translateX(18px);
}

/* Premium Skeleton Loaders */
@keyframes shimmerPulse {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.product-card.is-loading {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06) !important;
    box-shadow: none !important;
}

.product-card.is-loading .product-img-wrap,
.product-card.is-loading .p-title,
.product-card.is-loading .p-price,
.product-card.is-loading .p-category {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmerPulse 1.5s infinite linear !important;
    border-radius: 4px !important;
}

.product-card.is-loading .product-img-wrap {
    height: 250px;
    border-radius: 16px 16px 0 0 !important;
}
.product-card.is-loading .p-category {
    height: 12px;
    width: 40%;
    margin-bottom: 12px;
}
.product-card.is-loading .p-title {
    height: 20px;
    width: 80%;
    margin-bottom: 16px;
}
.product-card.is-loading .p-price {
    height: 24px;
    width: 30%;
}

/* =========================================================
   Mobile Responsiveness Overrides
   ========================================================= */
@media (max-width: 768px) {
    /* Make sidebar non-sticky so it stacks properly if shown */
    .catalog-sidebar {
        position: static;
        height: auto;
        padding-right: 0;
    }
    
    /* Make product cards look good on smaller grids */
    .product-img-wrap {
        padding: 1rem;
    }
    
    .product-card {
        border-radius: 12px !important;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .p-title {
        font-size: 0.95rem;
    }
    
    .p-price.current {
        font-size: 1.1rem !important;
    }
    
    .btn-card-add, .btn-card-buy, .btn-card-simple {
        padding: 8px 0;
        font-size: 0.75rem;
    }
}
