/* =====================================================================
   ADVENTEK Mobile Shop — Progressive Web App styles
   Phone-first, app-like full-screen layout
   ===================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.shop-app {
    background: #f8fafc;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 90px; /* room for bottom nav */
    padding-top: env(safe-area-inset-top);
    min-height: 100vh;
}

/* ===== Header =================================================== */
.shop-header {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(180deg, #0a4faf 0%, #0a6cdb 100%);
    color: #fff;
    padding: 14px 16px 16px;
    box-shadow: 0 4px 12px -2px rgba(10, 79, 175, 0.3);
    padding-top: calc(14px + env(safe-area-inset-top));
}
.shop-header-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.shop-brand {
    display: flex; align-items: center; gap: 10px;
}
.shop-brand-img {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    object-fit: contain;
}
.shop-brand-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.shop-brand-text {
    display: flex; flex-direction: column;
    line-height: 1.1;
}
.shop-brand-text strong {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #ffffff;
}
.shop-brand-text small {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.shop-cart-pill {
    position: relative;
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
    color: #fff; font-size: 20px;
    backdrop-filter: blur(8px);
    transition: transform .15s;
}
.shop-cart-pill:active { transform: scale(0.92); }
.shop-cart-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: #e63946;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid #0a4faf;
    line-height: 1;
}

/* Search */
.shop-search {
    position: relative;
    display: flex; align-items: center;
    background: rgba(255,255,255,0.95);
    border-radius: 14px;
    padding: 0 14px;
    box-shadow: 0 4px 14px -2px rgba(0,0,0,0.18);
}
.shop-search input {
    flex: 1;
    border: 0; outline: 0;
    padding: 13px 0;
    background: transparent;
    font-size: 15px;
    color: #0f172a;
    font-family: inherit;
}
.shop-search input::placeholder { color: #94a3b8; }
.shop-search-icon {
    font-size: 16px; margin-right: 8px;
    color: #64748b;
}
.shop-search-clear {
    color: #94a3b8;
    text-decoration: none;
    padding: 8px;
    font-size: 14px;
    font-weight: 700;
}

/* ===== Category chips (horizontal scroll) ======================= */
.shop-chips {
    display: flex; gap: 8px;
    padding: 12px 16px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.shop-chips::-webkit-scrollbar { display: none; }
.shop-chip {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px;
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
    --chip-hex: #0a6cdb;
}
.shop-chip-icon { font-size: 15px; }
.shop-chip:active { transform: scale(0.96); }
.shop-chip.active {
    background: var(--chip-hex);
    color: #fff;
    border-color: var(--chip-hex);
    box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--chip-hex) 50%, transparent);
}

/* ===== Context bar (when filtering) ============================ */
.shop-context {
    padding: 10px 16px 0;
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #475569;
}
.shop-context strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}
.shop-context-icon { font-size: 16px; }
.shop-context-count {
    margin-left: auto;
    background: #e2e8f0;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    color: #0f172a;
}

/* ===== Product grid (2 columns on phone, 3+ on tablet) ========= */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 12px 24px;
}
@media (min-width: 600px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .shop-grid { grid-template-columns: repeat(4, 1fr); } }

.shop-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.08);
    transition: transform .12s, box-shadow .12s;
    display: flex; flex-direction: column;
    --card-hex: #0a6cdb;
}
.shop-card:active {
    transform: scale(0.97);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.shop-card-image {
    position: relative;
    aspect-ratio: 1;
    background: #f1f5f9;
    overflow: hidden;
}
.shop-card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.shop-card-fallback {
    display: none;
    position: absolute; inset: 0;
    align-items: center; justify-content: center;
    font-size: 40px;
    color: #cbd5e1;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}
.shop-card-badge {
    position: absolute; top: 8px; left: 8px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(220,38,38,0.4);
}
.shop-card-oos {
    position: absolute; top: 8px; right: 8px;
    background: rgba(15,23,42,0.85);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.shop-card-body {
    padding: 10px 12px 12px;
    display: flex; flex-direction: column;
    gap: 4px;
    flex: 1;
}
.shop-card-cat {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--card-hex);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: color-mix(in srgb, var(--card-hex) 8%, transparent);
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.shop-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin: 2px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shop-card-price {
    display: flex; align-items: baseline; gap: 6px;
    margin-top: auto;
}
.shop-card-mrp {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 11px;
}
.shop-card-now {
    color: #0f172a;
    font-weight: 900;
    font-size: 16px;
    letter-spacing: -0.01em;
}
.shop-card-broc {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    background: rgba(220,38,38,0.08);
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 4px;
    align-self: flex-start;
}

/* ===== Empty state ============================================= */
.shop-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 32px;
    color: #64748b;
}
.shop-empty-icon { font-size: 60px; margin-bottom: 12px; }
.shop-empty h2 { font-size: 18px; color: #0f172a; margin: 0 0 6px; }
.shop-empty p { font-size: 14px; margin: 0 0 18px; }
.shop-btn {
    display: inline-block;
    padding: 10px 22px;
    background: linear-gradient(135deg, #0a6cdb, #0a4faf);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
    box-shadow: 0 6px 16px -2px rgba(10,108,219,0.4);
}

/* ===== Bottom navigation ======================================= */
.shop-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -4px 16px -4px rgba(15, 23, 42, 0.08);
    display: flex;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}
.shop-bn-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center;
    gap: 2px;
    padding: 8px 6px;
    text-decoration: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    position: relative;
    transition: color .15s;
}
.shop-bn-icon {
    font-size: 22px;
    line-height: 1;
}
.shop-bn-item.active,
.shop-bn-item:active {
    color: #0a6cdb;
}
.shop-bn-item.active::before {
    content: '';
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 24px; height: 3px;
    background: #0a6cdb;
    border-radius: 0 0 4px 4px;
}
.shop-bn-badge {
    position: absolute; top: 4px; right: calc(50% - 24px);
    min-width: 18px; height: 18px;
    background: #e63946; color: #fff;
    border-radius: 9px;
    font-size: 10px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

/* ===== PWA install banner ===================================== */
.shop-install {
    position: fixed; bottom: 90px; left: 12px; right: 12px;
    background: linear-gradient(135deg, #0a4faf, #0a6cdb);
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 10px 30px -6px rgba(10, 79, 175, 0.5);
    z-index: 200;
    animation: shop-slide-up .3s ease;
}
.shop-install span { flex: 1; }
.shop-install button {
    background: #fff;
    color: #0a4faf;
    border: 0;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
}
.shop-install button#shop-install-close {
    background: rgba(255,255,255,0.18);
    color: #fff;
    padding: 6px 10px;
    font-size: 14px;
}
@keyframes shop-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
