/**
 * File: shop-style.css
 * Description: UI Enhancement - Fully Responsive Grid & Layout for PC, TAB, and Mobile.
 * Version: 15.0
 */

:root {
    --rahi-green: #10b981;
    --rahi-green-bg: #f0fdf4;
    --rahi-bg: #f8fafc; 
    --rahi-text-main: #1e293b;
    --rahi-text-muted: #64748b;
    --rahi-border: #f1f5f9;
}

body {
    background: var(--rahi-bg);
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Main Wrapper - Responsive Adjustments */
#main-app-wrapper { 
    display: flex; 
    height: 100vh; 
    background: var(--rahi-bg); 
    overflow: hidden;
    max-width: 100%; 
    margin: 0 auto; 
}

/* PC/Desktop View: Container Limit */
@media (min-width: 1400px) {
    #main-app-wrapper {
        max-width: 1400px;
        border-left: 1px solid #e2e8f0;
        border-right: 1px solid #e2e8f0;
    }
}

/* Sidebar Styling - Fixed Width */
.app-sidebar { 
    width: 80px; 
    background: #fff; 
    border-right: 1px solid #e2e8f0; 
    overflow-y: auto; 
    scrollbar-width: none; 
    flex-shrink: 0;
}
.app-sidebar::-webkit-scrollbar { display: none; }

/* Tablet & Mobile: Sidebar adjustments if needed */
@media (max-width: 768px) {
    .app-sidebar { width: 70px; }
}

.cat-item { padding: 15px 5px; text-align: center; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: all 0.2s; }
.cat-item.active { background: var(--rahi-green-bg); border-left: 4px solid var(--rahi-green); }
.cat-item span { font-size: 10px; font-weight: 700; display: block; margin-top: 5px; }

/* Content Area */
.app-content { 
    flex: 1; 
    overflow-y: auto; 
    padding: 15px; 
    padding-bottom: 120px; 
    background: var(--rahi-bg); 
    -webkit-overflow-scrolling: touch;
}

/* --- RESPONSIVE PRODUCT GRID --- */
.product-grid { 
    display: grid; 
    gap: 15px; 
}

/* Mobile: 2 Columns */
@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .app-content { padding: 10px; }
}

/* Small Tablets: 3 Columns */
@media (min-width: 481px) and (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Large Tablets / Small Laptops: 4 Columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* PC / Desktop: 5 or 6 Columns */
@media (min-width: 1025px) {
    .product-grid { grid-template-columns: repeat(6, 1fr); }
}

/* --- ENHANCED PRODUCT CARD --- */
.app-product-card { 
    background: #fff; 
    border: 1px solid rgba(0,0,0,0.05); 
    border-radius: 12px; 
    padding: 12px; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
}

.app-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.discount-badge {
    position: absolute; top: 0; left: 0; background: #2563eb; color: #fff;
    font-size: 10px; font-weight: 900; padding: 4px 6px; border-radius: 8px 0 8px 0; z-index: 5;
}

.prod-img-container {
    width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; margin-top: 5px; cursor: pointer;
}
.prod-img { max-width: 100%; max-height: 100%; object-fit: contain; }

.eta-pill {
    font-size: 9px; font-weight: 800; color: #9a3412; background: #fff7ed;
    padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 3px; margin: 8px 0 5px 0;
}

.prod-title { 
    font-size: 13px; font-weight: 600; color: #1f2937; line-height: 1.3;
    height: 34px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.prod-meta { font-size: 12px; color: #6b7280; margin: 4px 0; font-weight: 500; }

.price-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: 10px; gap: 5px; }
.price-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.prod-price { font-size: 15px; font-weight: 800; color: #000; line-height: 1; }
.old-price { font-size: 11px; text-decoration: line-through; color: #9ca3af; }
.savings-tag { font-size: 10px; color: var(--rahi-green); font-weight: 700; margin-bottom: 2px; }

/* ADD BUTTON */
.add-to-cart-container { width: 75px; flex-shrink: 0; }
.add-btn-init { 
    width: 100%; background: #fff; color: var(--rahi-green); border: 1.5px solid var(--rahi-green); 
    padding: 7px 0; border-radius: 8px; font-weight: 800; font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.add-btn-init:hover { background: var(--rahi-green); color: #fff; }

.qty-btn-box { 
    display: flex; align-items: center; justify-content: space-between; 
    background: var(--rahi-green-bg); border: 1px solid var(--rahi-green); border-radius: 8px; height: 32px; 
}
.qty-btn { background: none; border: none; color: var(--rahi-green); width: 25px; font-weight: 900; cursor: pointer; }
.qty-val { font-size: 13px; font-weight: 900; color: var(--rahi-green); }

/* --- POPUP & OVERLAY --- */
.rahi-bottom-sheet { 
    position: fixed; bottom: -100%; left: 0; right: 0; background: #fff; 
    z-index: 99999999; border-radius: 20px 20px 0 0; padding: 20px; 
    transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    max-width: 550px; margin: 0 auto; 
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3); 
    display: none; 
}
.sheet-overlay { 
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(0,0,0,0.6); z-index: 99999998; display: none; 
}

/* Sticky Cart Adjustment for PC */
@media (min-width: 1025px) {
    #rahi-sticky-cart {
        width: 400px !important;
        left: auto !important;
        right: 30px !important;
        transform: none !important;
    }
}