/* =============================================
   SWAWLAMBAN SHOP UI — Minimalist & Premium
   ============================================= */

/* ---- Shop Page Header ---- */
.shop-page-header {
    background: linear-gradient(135deg, var(--gau-brown) 0%, var(--gau-brown-dark) 100%);
    padding: 40px 0 30px;
    color: white;
}

.shop-page-header h1,
.shop-page-header h2,
.shop-page-header h3,
.shop-page-header p,
.shop-page-header span,
.shop-page-header a {
    color: white;
}

.shop-page-header a:hover {
    color: var(--haldi-yellow);
}

/* ---- Product Card (Minimalist) ---- */
.pc {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
    height: 100%;
}

.pc:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
    transform: translateY(-4px);
    border-color: rgba(0,0,0,0.1);
}

/* Image area — Fixed Aspect Ratio */
.pc-img-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    background: #f9f9f9;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    position: relative;
    height: auto;
}

.pc-img-wrap a {
    display: block;
    width: 100%; 
    height: 100%;
}

.pc-img-wrap img {
    width: 100%; 
    height: 100%;
    object-fit: contain; /* Better for professional product shots */
    display: block;
    transition: transform .5s ease;
}

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

/* ---- Visibility Enforcements (Fix for Dual Duality) ---- */
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
    
    /* Hide all mobile-specific bars/sheets on desktop */
    .shop-sticky-bar, 
    .bottom-sheet, 
    .bs-overlay,
    .sticky-cart-bar { 
        display: none !important; 
    }
}

@media (max-width: 991px) {
    .d-none { display: none !important; }
    
    /* Ensure desktop sidebar is hidden on mobile */
    aside.d-lg-block { 
        display: none !important; 
    }
    
    /* Ensure mobile sticky bar is prominent */
    .shop-sticky-bar {
        display: block !important;
    }
}

/* Grid Layouts - Unified & Minimal */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

@media (max-width: 1199px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

@media (max-width: 991px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 15px; }
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .pc-body { padding: 10px; }
    .pc-cat { font-size: .58rem; margin-bottom: 2px; }
    .pc-name { font-size: .78rem; margin-bottom: 5px; min-height: 2.4em; }
    .pc-price-now { font-size: .9rem; }
    .pc-price-old { font-size: .72rem; }
    .pc-pricing { gap: 5px; margin-bottom: 10px; }
    .pc-badge { font-size: .52rem; padding: 3px 7px; }
    .pc-discount-chip { font-size: .52rem; padding: 3px 7px; }
    .pc-rx { font-size: .65rem; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .pc-body { padding: 8px; }
    .pc-cat { font-size: .55rem; }
    .pc-name { font-size: .72rem; min-height: 2.2em; -webkit-line-clamp: 2; }
    .pc-price-now { font-size: .85rem; }
    .pc-price-old { font-size: .68rem; }
    .pc-pricing { margin-bottom: 8px; }
    /* Buttons compact */
    .add-to-cart-btn { padding: 7px 6px; font-size: .62rem; gap: 4px; }
    .btn-buy-now { padding: 7px 6px; font-size: .62rem; }
    .card-buttons-group { gap: 5px; }
    /* Hide overlay on touch */
    .pc-overlay { display: none; }
    /* Badges smaller */
    .pc-badges { top: 6px; left: 6px; gap: 3px; }
    .pc-badge { font-size: .5rem; padding: 2px 6px; }
    .pc-discount-chip { font-size: .5rem; padding: 2px 6px; top: 6px; right: 6px; }
    /* Placeholder icon smaller */
    .pc-img-placeholder i { font-size: 2rem !important; }
    .pc-img-placeholder span { font-size: 0.65rem !important; margin-top: 6px !important; }
}

/* ---- Quantity Selector in Product Card ---- */
.product-card-qty {
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 2px;
    gap: 0;
    width: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.product-card-qty .qty-btn {
    background: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #111;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-card-qty .qty-btn:hover {
    background: #111;
    color: white;
}

.product-card-qty .qty-val {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #111;
}

@media (max-width: 480px) {
    .product-card-qty .qty-btn { width: 32px; height: 32px; font-size: 0.85rem; }
    .product-card-qty .qty-val { font-size: 0.85rem; }
}

/* ---- Quantity Selector in Product Detail ---- */
.detail-qty-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.qty-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #444;
}

.detail-qty-selector {
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(0,0,0,0.05);
}

.detail-qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-qty-btn:hover {
    background: #111;
    color: white;
}

.detail-qty-value {
    min-width: 50px;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #111;
}

.detail-btn-checkout {
    flex: 1;
}

.detail-actions-initial {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.detail-buy-now-form {
    flex: 1.2;
}

@media (max-width: 575px) {
    .detail-qty-group { flex-direction: column; align-items: stretch; gap: 12px; }
    .detail-qty-selector { justify-content: space-between; }
    .detail-qty-btn { width: 40px; height: 40px; }
    .detail-actions-initial { flex-wrap: wrap; }
    .detail-add-btn, .detail-buy-btn { flex: 1; min-width: 140px; }
}

/* ---- Skeleton Loading System ---- */
.skeleton {
    background: #f0f0f0;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-grid {
    display: none; /* Only show via HTMX-request */
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    width: 100%;
}

.htmx-request.product-results-wrap .product-grid {
    display: none !important;
}

.htmx-request.product-results-wrap .skeleton-grid {
    display: grid !important;
}

.skeleton-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #f5f5f5;
}

.sk-img { width: 100%; aspect-ratio: 1/1; border-radius: 12px; margin-bottom: 12px; }
.sk-line { height: 14px; width: 80%; margin-bottom: 8px; }
.sk-line-sm { height: 10px; width: 40%; }

@media (max-width: 1199px) { .skeleton-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .skeleton-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ---- Premium Pagination ---- */
.shop-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
    padding: 20px 0;
}

.sp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 50px;
    background: #fff;
    border: 1px solid #eee;
    color: #444;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.sp-btn:hover:not(.disabled):not(.active) {
    background: #f8f8f8;
    border-color: #ddd;
    color: #111;
    transform: translateY(-2px);
}

.sp-btn.active {
    background: #111;
    border-color: #111;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sp-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #fbfbfb;
}

.sp-btn i {
    font-size: 0.8rem;
}

/* Active Filter Chips */
.sf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.sf-chip {
    background: #111;
    color: #fff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.sf-chip:hover {
    opacity: 0.8;
}

.sf-chip i {
    font-size: 0.8rem;
}

/* Hover overlay actions */
.pc-overlay {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; gap: 12px;
    opacity: 0; transition: opacity .3s;
    z-index: 4;
}
.pc:hover .pc-overlay { opacity: 1; }

.pc-overlay-btn {
    background: #1a1a1a; border: none; border-radius: 50px;
    padding: 8px 18px; font-size: .75rem; font-weight: 700;
    color: #fff; cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: all .2s;
}
.pc-overlay-btn:hover { transform: scale(1.05); opacity: 0.9; }
.pc-overlay-btn.wish { width: 36px; height: 36px; padding: 0; justify-content: center; background: #fff; color: #1a1a1a; border: 1px solid #eee; }
.pc-overlay-btn.wish.active { color: #ff4d4d; border-color: #ffcaca; }

/* Badges */
.pc-badges {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    display: flex; flex-direction: column; gap: 6px;
}
.pc-badge {
    font-size: .6rem; font-weight: 800; padding: 4px 10px;
    border-radius: 50px; background: #fff; color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pc-discount-chip {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    background: #ff4d4d; color: #fff;
    font-size: .6rem; font-weight: 800;
    padding: 4px 10px; border-radius: 50px;
}

/* Body */
.pc-body {
    padding: 15px;
    display: flex; flex-direction: column; flex: 1;
}
.pc-cat {
    font-size: .65rem; font-weight: 600; color: #999;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.pc-name {
    font-size: .95rem; font-weight: 700; color: #1a1a1a;
    line-height: 1.4; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.8em;
}
.pc-name a { color: inherit; text-decoration: none; }

.pc-pricing {
    display: flex; align-items: baseline; gap: 8px; margin-bottom: 15px;
}
.pc-price-now { font-size: 1.1rem; font-weight: 800; color: #1a1a1a; }
.pc-price-old { font-size: .85rem; color: #ccc; text-decoration: line-through; }

/* Add to Cart */
.pc-add-btn {
    width: 100%; padding: 12px;
    background: #111; color: #fff;
    border: none; border-radius: 8px;
    font-size: .8rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .2s;
    margin-top: auto;
}
.pc-add-btn:hover { background: #333; }
.pc-add-btn:active { transform: scale(.98); }

/* Filters & Sidebar (Minimal & Functional) */
.shop-sidebar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 24px;
    position: sticky;
    top: 100px;
}

.sf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.sf-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #111;
}

.sf-clear-all {
    background: none;
    border: none;
    color: #ff4d4d;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.sf-clear-all:hover {
    text-decoration: underline;
}

.sf-section {
    margin-bottom: 25px;
}

.sf-title {
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: #111;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.sf-title i {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.collapsed .sf-title i {
    transform: rotate(-90deg);
}

.collapsed .sf-body {
    display: none;
}

.sf-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sf-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    transition: color 0.2s;
}

.sf-option:hover {
    color: #111;
}

.sf-option input[type="checkbox"],
.sf-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #111;
    cursor: pointer;
}

/* Price Inputs */
.sf-price-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sf-price-inputs input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 0.8rem;
    background: #fbfbfb;
}

.sf-price-inputs input:focus {
    outline: none;
    border-color: #111;
}

/* Toggle switch (Minimalist) */
.sf-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sf-toggle-label {
    font-size: 0.85rem;
    color: #555;
}

.toggle-sw {
    position: relative;
    width: 36px;
    height: 20px;
}

.toggle-sw input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-sw .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #eee;
    transition: .4s;
    border-radius: 20px;
}

.toggle-sw .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-sw input:checked + .slider {
    background-color: #111;
}

.toggle-sw input:checked + .slider:before {
    transform: translateX(16px);
}

/* ---- Sticky Sort + Filter Bar ---- */
.shop-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 12px 0;
}

.shop-sticky-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-result-count {
    font-size: 0.85rem;
    color: #888;
}

.shop-result-count strong {
    color: #111;
}

/* Mobile Filter/Sort Buttons */
.mob-filter-btn, .mob-sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #111;
}

/* ---- Component: Bottom Sheet (Mobile) ---- */
.bs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bs-overlay.open {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 24px 24px 0 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bs-handle {
    width: 40px;
    height: 4px;
    background: #eee;
    border-radius: 10px;
    margin: 12px auto;
}

.bs-header {
    padding: 0 24px 16px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bs-header h6 {
    margin: 0;
    font-weight: 800;
}

.bs-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #ccc;
}

.bs-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.bs-footer {
    padding: 16px 24px;
    border-top: 1px solid #f5f5f5;
    background: #fff;
    display: flex;
    gap: 12px;
}

.btn-clear {
    flex: 1;
    padding: 14px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    color: #555;
}

.btn-apply {
    flex: 2;
    padding: 14px;
    background: #111;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    color: #fff;
}

/* Sort Pills (Desktop) */
.sort-pills {
    display: flex;
    gap: 8px;
}

.sort-pill {
    padding: 8px 16px;
    border: 1px solid #eee;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #888;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-pill.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

/* Grid Layouts - Unified & Minimal */

/* ---- Button Spinner ---- */
.btn-spinner {
    width: 15px; height: 15px;
    border-radius: 50%;
    animation: btn-spin .65s linear infinite;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { pointer-events: none; opacity: .8; }

/* Yellow spinner for Add to Cart (dark background) */
.add-to-cart-btn .btn-spinner {
    border: 2.5px solid rgba(230, 179, 37, 0.3);
    border-top-color: #E6B325;
}

/* Brown spinner for Buy Now (light/white background) */
.btn-buy-now .btn-spinner {
    border: 2.5px solid rgba(122, 74, 46, 0.25);
    border-top-color: #7A4A2E;
}
