:root {
    /* Color Palette */
    --bg-color: #0b0f19;
    --bg-secondary: #141b2d;
    --bg-card: rgba(20, 27, 45, 0.65);
    --primary-color: #10b981; /* Emerald Green */
    --primary-hover: #34d399;
    --primary-glow: rgba(16, 185, 129, 0.25);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    /* Store Colors */
    --store-nahdi: #0ea5e9; /* Blue */
    --store-dawaa: #f59e0b; /* Amber/Orange */
    --store-united: #8b5cf6; /* Purple */
    
    /* Layout */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(14, 165, 233, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 10px var(--primary-color));
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-notif-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}
.header-notif-btn:hover { background: rgba(255, 255, 255, 0.08); }
.header-notif-btn svg { width: 22px; height: 22px; }
.header-notif-btn.has-unread { color: #10b981; }

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg-color);
    line-height: 1;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 400;
}

/* Search Area */
.search-container {
    max-width: 720px;
    margin: 0 auto 2.5rem auto;
    position: relative;
    z-index: 10;
}

.search-form {
    display: flex;
    background: rgba(20, 27, 45, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.4rem;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}

.search-form:focus-within {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 25px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem 1.5rem;
    color: var(--text-main);
    font-size: 1.15rem;
    font-family: inherit;
    outline: none;
}

.search-input::placeholder {
    color: #4b5563;
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: var(--transition-smooth);
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.search-btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Quick pills & History chips */
.search-chips {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
}

.chip-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.4rem;
}

a.quick-pill {
    text-decoration: none;
    color: var(--text-muted);
}
.quick-pill, .history-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.quick-pill:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--primary-hover);
    transform: translateY(-1px);
}

.history-pill {
    background: rgba(14, 165, 233, 0.05);
    border-color: rgba(14, 165, 233, 0.1);
    color: #e0f2fe;
}

.history-pill:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
    transform: translateY(-1px);
}

.history-pill .delete-history-item {
    font-size: 0.8rem;
    margin-right: 0.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.history-pill .delete-history-item:hover {
    opacity: 1;
    color: #ef4444;
}

.clear-history-btn {
    background: transparent;
    border: none;
    color: #f87171;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.clear-history-btn:hover {
    opacity: 1;
}

/* Best Deals Section */
.deals-section {
    max-width: 1100px;
    margin: 0 auto 3rem auto;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.deals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.deals-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.deals-subtitle {
    font-size: 1rem;
    font-weight: 400;
    -webkit-text-fill-color: var(--text-muted);
    margin-right: 1rem;
}

.deals-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.95rem;
}

.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.deal-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.deal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(251, 191, 36, 0.08);
}

.deal-img-wrap {
    height: 150px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.deal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.deal-img-placeholder {
    font-size: 3rem;
    opacity: 0.5;
}

.deal-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

.deal-store-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    align-self: flex-start;
}

.deal-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.deal-offer-tag {
    font-size: 0.72rem;
    color: #fb7185;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    align-self: flex-start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.deal-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.deal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.deal-currency {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.deal-unit-price {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.deal-price-strike {
    font-size: 0.95rem;
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 0.4rem;
}

.deal-promo-label {
    font-size: 0.7rem;
    color: #34d399;
    font-weight: 600;
    margin-top: 0.1rem;
}

.deal-buy-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}
.deal-actions-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.deal-basket-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}
.deal-basket-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary-color);
    transform: scale(1.1);
}
.deal-basket-btn.in-basket {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(16,185,129,0.2);
}
.deal-fav-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.5);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.deal-fav-btn:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}
.deal-fav-btn.active {
    background: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 10px rgba(239,68,68,0.3);
}

.deals-count-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.deals-load-more {
    display: block;
    margin: 2rem auto 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.7rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
}
.deals-load-more:hover {
    background: rgba(16,185,129,0.1);
    border-color: var(--primary-color);
    color: var(--primary-hover);
}

.deal-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.deal-type-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 700;
}

.deal-type-offer {
    background: rgba(239, 68, 68, 0.15);
    color: #fb7185;
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulseGlow 2s infinite alternate;
}

.deal-type-regular {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.deal-card.has-offer {
    border-color: rgba(239, 68, 68, 0.2);
    background: linear-gradient(135deg, rgba(20,27,45,0.8) 0%, rgba(40,20,30,0.6) 100%);
}

.deal-card.has-offer:hover {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3), 0 0 20px rgba(239,68,68,0.08);
}

/* Loading & Error States */
.loading-state, .error-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem auto;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background: var(--bg-secondary);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.sort-indicator {
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Product Card */
/* Product Card & Skeletons */
.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.result-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
    border-color: var(--border-hover);
}

.best-price-badge {
    position: absolute;
    top: 1.2rem;
    right: -2.2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #059669 100%);
    color: white;
    padding: 0.3rem 2.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    transform: rotate(45deg);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.card-image-wrapper {
    height: 190px;
    background: #ffffff;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-card:hover .product-image {
    transform: scale(1.08);
}

.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.store-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.store-nahdi { background: rgba(14, 165, 233, 0.12); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.25); }
.store-dawaa { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.store-united { background: rgba(139, 92, 246, 0.12); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.25); }

.offer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(244, 63, 94, 0.12) 100%);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.25);
    animation: pulseGlow 2s infinite alternate;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.favorite-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem;
    transition: var(--transition-smooth);
}

.favorite-btn.active {
    color: #eab308;
    transform: scale(1.15);
}

.product-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3rem;
    flex: 1;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    margin-bottom: 1rem;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.price-currency {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.price-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #ffffff;
}

.basket-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.basket-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-hover);
    transform: scale(1.05);
}

.share-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
    transition: var(--transition-smooth);
}
.share-btn:hover {
    color: #25d366;
    transform: scale(1.15);
}

.alert-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: #f59e0b;
    cursor: pointer;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(4px);
    transition: var(--transition-smooth);
    -webkit-tap-highlight-color: transparent;
}
.alert-btn:hover, .alert-btn:active {
    background: rgba(245, 158, 11, 0.4);
    transform: scale(1.15);
}

.card-alert-popup {
    position: absolute;
    top: 3rem;
    left: 0;
    z-index: 50;
}
.card-alert-popup-inner {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    min-width: 180px;
}
.card-alert-popup-title {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-align: center;
}
.card-alert-popup-row {
    display: flex;
    gap: 0.3rem;
}
.card-alert-input {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.8rem;
    width: 80px;
}
.card-alert-ok-btn {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: none;
    background: #10b981;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
}
.card-alert-ok-btn:hover { background: #059669; }

.alerts-toggle {
    position: fixed;
    bottom: 5.5rem;
    left: 1rem;
    z-index: 99;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: var(--shadow);
    transition: var(--transition-smooth);
}
.alerts-toggle:hover { transform: scale(1.1); border-color: #f59e0b; }

/* Install App FAB */
.install-fab {
    position: fixed;
    bottom: 11rem;
    left: 1rem;
    z-index: 98;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 28px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    transition: var(--transition-smooth);
    font-family: inherit;
    white-space: nowrap;
}
.install-fab:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5); }
.install-fab-text { font-size: 0.8rem; font-weight: 600; }

.alerts-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}
.alerts-drawer.open { transform: translateX(0); }

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.alert-item-name { color: var(--text-main); font-size: 0.85rem; }
.alert-item-price { color: #10b981; font-size: 0.8rem; font-weight: 600; }
.alert-item-del { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 1rem; }

/* Notifications */
.notif-panel {
    position: fixed;
    top: 58px;
    right: 0;
    width: 360px;
    max-width: 100vw;
    max-height: calc(100vh - 60px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 200;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.notif-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}
.notif-overlay {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0,0,0,0.3);
}
.notif-overlay.hidden { display: none; }
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.notif-panel-header h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin: 0;
}
.notif-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}
.notif-close-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-main); }
.notif-list {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.notif-item {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.notif-item:hover { border-color: var(--primary-color); }
.notif-item-title { color: var(--text-main); font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; }
.notif-item-body { color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; }
.notif-item-time { color: var(--text-muted); font-size: 0.7rem; margin-top: 0.35rem; opacity: 0.7; }
.notif-item.unread { border-color: var(--primary-color); background: rgba(16, 185, 129, 0.05); }

/* Enable Notifications Banner */
.enable-notif-banner {
    position: fixed;
    bottom: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    background: var(--bg-secondary);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
    width: calc(100% - 2rem);
    max-width: 420px;
    animation: slideUpFade 0.4s ease;
}
.enable-notif-banner.hidden { display: none; }
.enable-notif-content { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.enable-notif-icon { font-size: 1.8rem; }
.enable-notif-text { display: flex; flex-direction: column; }
.enable-notif-text strong { color: var(--text-main); font-size: 0.9rem; }
.enable-notif-text span { color: var(--text-muted); font-size: 0.75rem; }
.enable-notif-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.enable-notif-enable {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-smooth);
}
.enable-notif-enable:hover { transform: scale(1.03); }
.enable-notif-enable:disabled { opacity: 0.7; cursor: wait; }
.enable-notif-error { color: #ef4444; font-size: 0.75rem; }
.enable-notif-error.show { display: block; }
.enable-notif-btn-row { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.enable-notif-dismiss-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
    line-height: 1;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.buy-btn {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: var(--text-main);
    text-decoration: none;
    padding: 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.buy-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Skeleton Loading Cards */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 380px;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    position: relative;
}

.skeleton-shimmer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.03) 20%, 
        rgba(255, 255, 255, 0.08) 60%, 
        rgba(255, 255, 255, 0) 100%);
    animation: shimmer 1.5s infinite;
}

.skeleton-img {
    height: 150px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 18px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 100%; }

.skeleton-button {
    height: 36px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-top: auto;
}

/* Floating Basket Toggle Button */
.basket-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #059669 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4), 0 0 0 5px rgba(16, 185, 129, 0.1);
    z-index: 99;
    border: none;
    transition: var(--transition-smooth);
}

.basket-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.5), 0 0 0 7px rgba(16, 185, 129, 0.2);
}

.basket-toggle:active {
    transform: translateY(1px) scale(0.95);
}

.basket-toggle-icon {
    font-size: 1.6rem;
}

.basket-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Smart Comparison Basket Drawer */
.basket-drawer {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid var(--border-color);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.basket-drawer.open {
    transform: translateX(400px);
}

.basket-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.basket-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.basket-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.basket-close-btn:hover {
    color: #ef4444;
}

.basket-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.empty-basket-state {
    text-align: center;
    color: var(--text-muted);
    margin: auto 0;
    padding: 2rem;
}

.empty-basket-state .basket-icon-large {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Basket Items List */
.basket-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.basket-item-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 6px;
    padding: 0.25rem;
}

.basket-item-info {
    flex: 1;
    min-width: 0;
}

.basket-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.basket-item-store {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.basket-item-price-tag {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-hover);
}

.remove-basket-item {
    background: transparent;
    border: none;
    color: rgba(239, 68, 68, 0.6);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
    transition: var(--transition-smooth);
}

.remove-basket-item:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* Basket Calculations & Comparison Table */
.basket-comparison-dashboard {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-top: auto;
}

.dashboard-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-basket-btn {
    background: transparent;
    border: none;
    color: #f87171;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.8;
}

.clear-basket-btn:hover {
    opacity: 1;
}

.store-price-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.store-price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.store-price-row:last-child {
    border-bottom: none;
}

.store-name-col {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.store-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.store-dot.nahdi { background: var(--store-nahdi); }
.store-dot.dawaa { background: var(--store-dawaa); }
.store-dot.united { background: var(--store-united); }

.store-total-col {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.store-total-col.winner {
    color: var(--primary-color);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.basket-winner-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    text-align: center;
    color: #a7f3d0;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: pulseGlow 2.5s infinite alternate;
}

/* Detailed Comparison Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 680px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal-overlay.open .modal-container {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.modal-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
}

.modal-image-wrapper {
    background: #ffffff;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--border-color);
}

.modal-image {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.modal-content-panel {
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
}

.modal-store-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.modal-price-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-price-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-price-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-hover);
}

/* Cross-Store Price Comparison Table in Modal */
.modal-comparison-section {
    margin-top: 0.5rem;
}

.modal-comparison-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.85rem;
}

.equivalents-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.equivalent-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.equivalent-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.eq-store-name {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.eq-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
}

.eq-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: color 0.2s;
}

.eq-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.eq-missing {
    color: #ef4444;
    font-size: 0.8rem;
    font-style: italic;
}

/* Footer */
.footer {
    margin-top: auto;
    text-align: center;
    padding-top: 4rem;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.6;
}
.footer-content {
    max-width: 600px;
    margin: 0 auto;
}
.footer-meta {
    font-size: 0.8rem;
    color: #374151;
    margin-top: 0.5rem;
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 9998;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
}
.pwa-install-icon {
    font-size: 2rem;
    flex-shrink: 0;
}
.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.pwa-install-text strong {
    font-size: 0.9rem;
    color: #fff;
}
.pwa-install-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.pwa-install-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}
.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.pwa-dismiss-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
    flex-shrink: 0;
}
.pwa-dismiss-btn:hover {
    color: #ef4444;
}

@media (max-width: 480px) {
    .pwa-install-banner { padding: 0.6rem 0.8rem; gap: 0.5rem; }
    .pwa-install-icon { font-size: 1.5rem; }
    .pwa-install-text strong { font-size: 0.8rem; }
    .pwa-install-text span { font-size: 0.65rem; }
    .pwa-install-btn { font-size: 0.75rem; padding: 0.4rem 1rem; }
}


/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.15);
        border-color: rgba(16, 185, 129, 0.2);
    }
    to {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
        border-color: rgba(16, 185, 129, 0.6);
    }
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.card-enter {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
.splash-logo {
    margin-bottom: 1rem;
    animation: pulseGlow 2s infinite alternate;
}
.splash-logo svg {
    width: 100px;
    height: 100px;
    display: block;
}
.splash-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.splash-sub {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1rem;
}
.splash-loader {
    margin-top: 2rem;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@media (max-width: 768px) {
    .app-container { padding: 1.2rem 1rem; }
    .header { margin-bottom: 1rem; padding: 0.5rem 0.8rem; }
    .header h1 { font-size: 1.4rem; }
    .header h1 span { font-size: 0.8rem; }
    .logo-icon { width: 34px; height: 34px; }
    .subtitle { font-size: 1rem; }
    .search-form { flex-direction: row; }
    .search-input { padding: 0.7rem 1rem; font-size: 1rem; }
    .search-btn { width: 42px; height: 42px; }

    .deals-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .deals-header h2 { font-size: 1.4rem; }
    .deals-subtitle { font-size: 0.85rem; margin-right: 0; }
    .deals-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
    .deal-img-wrap { height: 110px; }
    .deal-body { padding: 0.65rem; }
    .deal-name { font-size: 0.78rem; }
    .deal-price { font-size: 1rem; }
    .deal-offer-tag { font-size: 0.6rem; max-width: 100%; }
    .deal-price-strike { font-size: 0.8rem; }
    .deal-buy-btn { font-size: 0.7rem; padding: 0.3rem 0.7rem; }
    .deal-basket-btn { width: 28px; height: 28px; font-size: 0.75rem; }
    .deal-fav-btn { width: 26px; height: 26px; font-size: 0.7rem; }

    .results-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
    .results-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .results-header h2 { font-size: 1.2rem; }
    .sort-indicator { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
    .card-image-wrapper { height: 130px; }
    .card-content { padding: 0.85rem; }
    .product-name { font-size: 0.85rem; height: 2.5rem; }
    .price-value { font-size: 1.2rem; }
    .price-currency { font-size: 0.7rem; }
    .buy-btn { font-size: 0.8rem; padding: 0.5rem; }
    .basket-btn { width: 32px; height: 32px; font-size: 0.8rem; }
    
    .basket-drawer {
        width: 100%;
        left: -100%;
    }
    .basket-drawer.open {
        transform: translateX(100%);
    }
    .basket-toggle { bottom: 1.2rem; left: 1.2rem; width: 52px; height: 52px; }
    .basket-toggle-icon { font-size: 1.3rem; }
    
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .modal-image-wrapper {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
    }
    .modal-content-panel {
        padding: 1.5rem;
    }
    .modal-close-btn {
        left: 0.8rem;
        top: 0.8rem;
    }
    .modal-title { font-size: 1.1rem; }
    .modal-price-value { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .app-container { padding: 0.8rem 0.6rem; }
    .header { padding: 0.4rem 0.6rem; }
    .header h1 { font-size: 1.2rem; }
    .header h1 span { font-size: 0.75rem; }
    .logo-icon { width: 30px; height: 30px; }
    .search-input { font-size: 0.85rem; padding: 0.55rem 0.8rem; }
    .search-btn { width: 36px; height: 36px; }
    .search-btn svg { width: 18px; height: 18px; }
    .search-chips { gap: 0.4rem; }
    .quick-pill, .history-pill { font-size: 0.72rem; padding: 0.25rem 0.6rem; }
    .chip-label { font-size: 0.7rem; }

    .deals-header h2 { font-size: 1.1rem; }
    .deals-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
    .deal-img-wrap { height: 90px; padding: 0.5rem; }
    .deal-body { padding: 0.5rem; gap: 0.3rem; }
    .deal-store-badge { font-size: 0.6rem; padding: 0.15rem 0.4rem; }
    .deal-name { font-size: 0.7rem; -webkit-line-clamp: 2; }
    .deal-price { font-size: 0.9rem; }
    .deal-currency { font-size: 0.65rem; }
    .deal-offer-tag { font-size: 0.55rem; padding: 0.1rem 0.35rem; }
    .deal-price-strike { font-size: 0.7rem; }
    .deal-promo-label { font-size: 0.6rem; }
    .deal-buy-btn { font-size: 0.65rem; padding: 0.25rem 0.6rem; }
    .deal-basket-btn { width: 24px; height: 24px; font-size: 0.65rem; }
    .deal-fav-btn { width: 22px; height: 22px; font-size: 0.6rem; top: 0.3rem; right: 0.3rem; }
    .deal-unit-price { font-size: 0.6rem; }
    .deals-count-badge { font-size: 0.65rem; }
    .deals-load-more { font-size: 0.8rem; padding: 0.5rem 1.2rem; }
    .deal-type-badge { font-size: 0.55rem; }

    .results-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .results-header h2 { font-size: 1rem; }
    .badge { font-size: 0.75rem; }
    .sort-indicator { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
    .card-image-wrapper { height: 120px; padding: 0.8rem; }
    .card-content { padding: 0.8rem; }
    .card-meta-row { margin-bottom: 0.5rem; flex-wrap: wrap; gap: 0.5rem; }
    .store-badge { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
    .product-name { font-size: 0.85rem; height: auto; max-height: 2.6rem; margin-bottom: 0.6rem; }
    .price-row { margin-bottom: 0.6rem; }
    .price-value { font-size: 1.1rem; }
    .price-currency { font-size: 0.65rem; }
    .buy-btn { font-size: 0.75rem; padding: 0.5rem; }
    .card-actions { gap: 0.8rem; }
    .basket-btn { width: 36px; height: 36px; font-size: 0.9rem; }
    .favorite-btn { font-size: 1.1rem; padding: 0.3rem; }
    .share-btn { font-size: 1.1rem; padding: 0.3rem; }
    .alert-btn { width: 44px; height: 44px; font-size: 1.5rem; top: 0.5rem; left: 0.5rem; }
    .offer-badge { font-size: 0.6rem; padding: 0.15rem 0.4rem; }
    .promo-price-tag { font-size: 0.65rem; }
    .price-value-strikethrough { font-size: 0.85rem; }

    .basket-toggle { bottom: 0.8rem; left: 0.8rem; width: 46px; height: 46px; }
    .basket-count { width: 18px; height: 18px; font-size: 0.65rem; }
    .basket-drawer { width: 100%; left: -100%; }
    .basket-header { padding: 1rem; }
    .basket-header h3 { font-size: 1.1rem; }
    .basket-body { padding: 1rem; }
    
    .modal-container { width: 95%; }
    .modal-image-wrapper { padding: 1rem; }
    .modal-content-panel { padding: 1rem; }
    .modal-title { font-size: 1rem; }
    .modal-price-value { font-size: 1.2rem; }
    .modal-price-label { font-size: 0.75rem; }
    .modal-image { max-height: 150px; }
    
    .footer { font-size: 0.75rem; padding-top: 2rem; }
    .splash-logo { font-size: 3rem; }
    .splash-title { font-size: 1.8rem; }
    .splash-sub { font-size: 0.85rem; }
}

/* Quantity controls in Basket */
.basket-item-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.qty-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.qty-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-hover);
}

.qty-val {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    color: #ffffff;
}

/* Promo Price tags on cards */
.promo-price-tag {
    font-size: 0.82rem;
    font-weight: 600;
    color: #34d399;
    margin-bottom: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.price-value-strikethrough {
    font-size: 1.15rem;
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Checkout and Basket Improvements */
.checkout-store-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
}

.checkout-store-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-hover);
    transform: scale(1.05);
}

.basket-item-missing-section {
    margin-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.basket-custom-equiv-row, .basket-missing-equiv-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    width: 100%;
}

.bound-equiv-name {
    font-size: 0.75rem;
    color: #34d399;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.unbind-equiv-btn {
    background: transparent;
    border: none;
    color: rgba(239, 68, 68, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 0.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.unbind-equiv-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.suggest-pills-container {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.suggest-pill-btn {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: right;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.suggest-pill-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.checkout-item-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
}

.checkout-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.checkout-item-info {
    flex: 1;
    min-width: 0;
}

.checkout-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-item-price {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.checkout-item-link-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--primary-hover);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.checkout-item-link-btn:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.checkout-item-missing-badge {
    color: #ef4444;
    font-size: 0.8rem;
    font-style: italic;
    border: 1px dashed rgba(239, 68, 68, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.05);
}

/* ── Light Mode Overrides ─────────────────────────────────────────────── */
[data-theme="light"] body {
    background: #f5f5f0 !important;
    color: #1a1a1a !important;
}
[data-theme="light"] body,
[data-theme="light"] .app-container,
[data-theme="light"] .header,
[data-theme="light"] .main-content,
[data-theme="light"] .footer {
    background-color: transparent !important;
    color: #1a1a1a !important;
}
[data-theme="light"] .header {
    background: linear-gradient(180deg, #f5f5f0 0%, transparent 100%) !important;
}
[data-theme="light"] .header .subtitle { color: #555 !important; }
[data-theme="light"] .logo-icon { filter: none !important; }
[data-theme="light"] .header h1 span { color: #0d9668 !important; }


