
:root{--navy:#0f172a;--muted:#64748b;--blue:#2563eb;--teal:#0d9488;--line:#e5eaf0;--bg:#f7f9fc}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--navy);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}a{color:inherit;text-decoration:none}button,input{font:inherit}
.site-header{height:68px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;position:relative;z-index:5}.header-inner,.search-inner,.wrap{width:min(1280px,calc(100% - 48px));margin:auto}.header-inner{display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:11px;font-size:22px;font-weight:800;letter-spacing:-.5px}.brand-mark{width:35px;height:35px;border-radius:10px;background:var(--navy);color:white;display:grid;place-items:center;font-size:19px;position:relative}.brand-mark:after{content:"";position:absolute;width:9px;height:9px;background:#2dd4bf;right:-3px;bottom:-3px;border:3px solid white;border-radius:50%}.nav{display:flex;align-items:center;gap:30px;font-size:14px;font-weight:600;color:#475569}.nav a:first-child{color:var(--navy)}.nav .arabic{border-left:1px solid var(--line);padding-left:26px}
.search-panel{background:#eef3f9;border-bottom:1px solid #e3eaf2;padding:28px 0 25px}.search-inner{text-align:center}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.8px;color:var(--teal);margin-bottom:7px}.search-panel h1{font-size:31px;line-height:1.15;letter-spacing:-1px;margin:0 0 17px}.search-box{height:54px;max-width:850px;margin:0 auto;display:flex;background:white;border:1px solid #dbe3ed;border-radius:12px;padding:5px;box-shadow:0 8px 25px rgba(15,23,42,.06)}.search-box svg{width:21px;margin:10px 12px;stroke:#94a3b8}.search-box input{min-width:0;flex:1;border:0;outline:0;color:var(--navy);font-size:15px}.search-box button{border:0;border-radius:8px;background:var(--blue);color:white;padding:0 27px;font-weight:700;cursor:pointer}.chips{display:flex;justify-content:center;gap:8px;margin-top:13px;flex-wrap:wrap}.chips a{font-size:12px;background:#dfe8f3;color:#42536b;border-radius:20px;padding:6px 12px}.chips a:hover{background:#d4e0ee}
.categories{padding:22px 0 4px}.section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px;gap:16px}.section-heading>div:first-child{display:flex;align-items:baseline;gap:12px}.section-heading h2{font-size:21px;line-height:1.25;letter-spacing:-.45px;margin:0}.section-note{font-size:12px;color:var(--muted)}.section-actions{display:flex;align-items:center;gap:7px}.section-actions>a{font-size:12px;font-weight:700;color:var(--blue);margin-right:8px}.section-actions>a span{margin-left:3px}.round{width:30px;height:30px;border:1px solid #dce3eb;border-radius:50%;background:white;color:#64748b;font-size:22px;line-height:20px;cursor:pointer}.round:first-of-type{color:#cbd5e1}.category-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}.category-tile{height:91px;background:var(--tile);border-radius:10px;position:relative;overflow:hidden;display:flex;align-items:flex-end;justify-content:flex-end;padding:13px 14px;border:1px solid rgba(15,23,42,.035)}.category-tile img{position:absolute;left:5px;top:3px;width:52%;height:82px;object-fit:contain;mix-blend-mode:multiply}.category-tile span{position:relative;text-align:right;font-size:13px;line-height:1.15;font-weight:800;max-width:54%;color:#334155}.category-tile:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(15,23,42,.06)}
.deal-section{padding:24px 0 2px}.deal-section.featured{padding-top:26px}.product-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.product-card{min-width:0;background:white;border:1px solid var(--line);border-radius:10px;overflow:hidden;display:flex;flex-direction:column;transition:.15s ease}.product-card:hover{transform:translateY(-3px);box-shadow:0 10px 30px rgba(15,23,42,.09);border-color:#cbd8e6}.image-wrap{height:166px;position:relative;background:white;border-bottom:1px solid #f0f3f6;padding:12px}.image-wrap img{width:100%;height:100%;object-fit:contain;display:block}.discount{position:absolute;z-index:1;right:10px;top:10px;background:#e8f7ef;color:#168557;font-size:11px;font-weight:800;padding:4px 7px;border-radius:5px}.card-body{padding:12px 13px 10px;display:flex;flex-direction:column;flex:1}.store-line{height:18px;display:flex;justify-content:space-between;align-items:center;gap:5px;text-transform:uppercase;color:#0d9488;font-size:9px;font-weight:800;letter-spacing:.7px}.variant{color:#64748b;letter-spacing:0;text-transform:none;font-weight:600;font-size:9px}.card-body h3{font-size:12px;line-height:1.45;font-weight:600;color:#334155;margin:5px 0 10px;height:35px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.price-line{display:flex;align-items:baseline;gap:5px}.price-line strong{font-size:20px;letter-spacing:-.5px}.price-line span{font-size:10px;color:#64748b}.old-price{display:flex;justify-content:space-between;align-items:center;gap:4px;margin-top:3px;font-size:9px;color:#94a3b8}.save{color:#168557;font-weight:700;white-space:nowrap}.history{display:flex;align-items:center;border-top:1px solid #f0f3f6;margin-top:11px;padding-top:8px;color:#94a3b8;font-size:9px}.history svg{width:39px;height:16px;margin-right:6px}.history path{fill:none;stroke:#16a374;stroke-width:1.7}.history path.area{fill:#e9f8f1;stroke:none}.history .arrow{margin-left:auto;color:#64748b;font-size:14px}
.page-footer{margin-top:35px;padding:26px 0 32px;border-top:1px solid var(--line);background:white}.footer-inner{display:flex;justify-content:space-between;align-items:center;color:#64748b;font-size:12px}.footer-links{display:flex;gap:22px}.concept-tag{color:#94a3b8;font-size:10px}
@media(max-width:900px){.nav{gap:18px}.nav a:nth-child(2),.nav a:nth-child(3){display:none}.category-grid{grid-template-columns:repeat(3,1fr)}.product-row{grid-template-columns:repeat(3,minmax(0,1fr))}.product-card:nth-child(n+4){display:none}}
@media(max-width:600px){.header-inner,.search-inner,.wrap{width:calc(100% - 28px)}.site-header{height:60px}.brand{font-size:19px}.brand-mark{width:32px;height:32px}.nav{gap:14px;font-size:12px}.nav a:not(:last-child){display:none}.nav .arabic{border:0;padding:0}.search-panel{padding:24px 0 21px}.search-panel h1{font-size:27px;max-width:340px;margin:0 auto 16px}.eyebrow{font-size:9px}.search-box{height:50px}.search-box button{padding:0 17px}.search-box input{font-size:13px}.search-box svg{margin-left:6px;margin-right:5px}.chips{justify-content:flex-start;flex-wrap:nowrap;overflow:hidden}.chips a{white-space:nowrap;font-size:11px}.chips a:nth-child(n+5){display:none}.category-grid{gap:8px}.category-tile{height:82px;padding:10px}.category-tile img{height:64px;width:57%;left:0}.category-tile span{font-size:11px;max-width:60%}.section-heading h2{font-size:19px}.section-note{display:none}.section-actions>a{margin-right:2px}.round{display:none}.product-row{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px;padding-bottom:6px}.product-card{display:flex!important;min-width:207px;width:207px;scroll-snap-align:start}.image-wrap{height:150px}.deal-section{padding-top:22px}.footer-inner{display:block;line-height:2}.footer-links{margin-top:7px;gap:17px}.concept-tag{display:none}}

#ph-modal { display: none; }
#ph-modal.open { display: block; }
#ph-modal .ph-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 9998;
}
#ph-modal .ph-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    padding: 20px 22px;
    width: 380px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 9999;
}
#ph-modal .ph-close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
#ph-modal .ph-close:hover { color: #334155; }
#ph-modal .ph-title {
    font-weight: 700;
    font-size: .95rem;
    margin-right: 24px;
    margin-bottom: 2px;
}
#ph-modal .ph-sub {
    color: #64748b;
    font-size: .78rem;
    margin-bottom: 12px;
}
.ph-chart { width: 100%; height: auto; }
.ph-chart .ph-line {
    fill: none;
    stroke: #1a73e8;
    stroke-width: 2;
}
.ph-chart .ph-dot { fill: #1a73e8; }
.ph-chart .ph-axis { stroke: #e2e8f0; stroke-width: 1; }
.ph-chart .ph-lbl {
    font-size: 9px;
    fill: #94a3b8;
}
.ph-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin-top: 12px;
    font-size: .8rem;
}
.ph-stats span {
    display: block;
    color: #64748b;
    font-size: .72rem;
}
.ph-stats b { color: #0f172a; }
.ph-stats .ph-good { color: #137333; }

/* Tiny directional price-history corner badge */
.product-square { position: relative; }
.ph-arrow {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.62rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: transform .12s ease;
}
.ph-arrow:hover { transform: scale(1.2); }
.ph-down { color: #fff; background: #16a34a; }
.ph-up   { color: #fff; background: #dc2626; }
.ph-flat { color: #fff; background: #64748b; }

/* SWR freshness stamp + live-update flash */
.store-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}
.store-status.fresh {
    background: #22c55e;
    box-shadow: 0 0 3px rgba(34, 197, 94, .5);
}
.store-status.stale {
    background: #cbd5e1;
}
.swr-updated {
    animation: swrFlash 2.5s ease;
    border-radius: 8px;
}
@keyframes swrFlash {
    0% { box-shadow: 0 0 0 3px rgba(22, 163, 74, .35); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Accessory demotion group + strict-rescue note */
.acc-group {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}
.acc-group > summary {
    cursor: pointer;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.6rem;
    border-top: 1px dashed #e2e8f0;
    user-select: none;
    list-style: none;
}
.acc-group > summary::before {
    content: '\25B8';
    display: inline-block;
    margin-right: 6px;
    transition: transform .15s;
}
.acc-group[open] > summary::before {
    transform: rotate(90deg);
}
.acc-group > summary:hover { color: #1a73e8; }
.acc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.25rem;
}
.rescue-note {
    color: #92610a;
    background: #fef7e0;
    border: 1px solid #f0dfa8;
    border-radius: 6px;
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.5rem;
}

/* Sections size to content (no stretch, no grid growth) */
.store-section { align-self: start !important; }
.store-section .products-grid { flex: 0 0 auto !important; }

/* Masonry packing: sections flow down columns, no row-height whitespace */
.store-results-container {
    display: block !important;
    column-width: 300px;
    column-gap: 0.75rem;
}
.store-section {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 0.75rem;
    vertical-align: top;
}
.store-section[data-store="best-deals"] {
    column-span: all;
}

/* ===== Price history modal redesign (2026-08-12) ===== */
#ph-modal .ph-card { width: 460px; padding: 22px 24px; }
#ph-modal .ph-title {
    font-size: .92rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.35;
    margin-right: 24px;
    margin-bottom: 10px;
}
#ph-modal .ph-sub { display: none; }

.ph-cur-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}
.ph-eyebrow {
    color: #6b7280;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ph-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    color: #fff;
    background: #9ca3af;
    white-space: nowrap;
}
.ph-badge-great,
.ph-badge-very-good { background: #22c55e; }
.ph-badge-good { background: #86efac; color: #166534; }
.ph-badge-fair { background: #e5e7eb; color: #4b5563; }
.ph-badge-high { background: #fde68a; color: #92400e; }
.ph-badge-very-high { background: #fecaca; color: #b91c1c; }

.ph-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.ph-current { font-size: 1.7rem; font-weight: 700; color: #111827; }
.ph-current .ph-cur {
    font-size: .85rem;
    font-weight: 500;
    color: #6b7280;
    margin-left: 5px;
}
.ph-original {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: .95rem;
}
.ph-storename {
    color: #6b7280;
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.ph-divider { height: 1px; background: #eef0f3; margin: 14px 0; }

.ph-stats3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.ph-stat {
    background: #f9fafb;
    border: 1px solid #f1f3f5;
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
}
.ph-stat-lbl {
    display: block;
    color: #6b7280;
    font-size: .7rem;
    margin-bottom: 4px;
}
.ph-stat-val { font-size: 1.1rem; font-weight: 700; color: #111827; }
.ph-good { color: #16a34a !important; }
.ph-bad { color: #dc2626 !important; }

/* chart */
.ph-chart { width: 100%; height: auto; display: block; }
.ph-chart .ph-line {
    fill: none;
    stroke: #14b8a6;
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.ph-chart .ph-dot { fill: #14b8a6; stroke: #fff; stroke-width: 1.5; }
.ph-chart .ph-grid { stroke: #eef0f3; stroke-width: 1; }
.ph-chart .ph-axis { stroke: #e5e7eb; stroke-width: 1; }
.ph-chart .ph-ylbl,
.ph-chart .ph-lbl { font-size: 9.5px; fill: #9ca3af; }
.ph-chart .ph-axistitle { font-size: 10px; fill: #9ca3af; }
.ph-chart .ph-ptlbl {
    font-size: 9.5px;
    fill: #0f766e;
    font-weight: 600;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 3;
}
.ph-chart .ph-ref { stroke-dasharray: 5 4; stroke-width: 1.4; }
.ph-chart .ph-ref-max { stroke: #ef4444; }
.ph-chart .ph-ref-min { stroke: #14b8a6; }
.ph-chart .ph-reflbl {
    font-size: 9.5px;
    font-weight: 600;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 3;
}
.ph-chart .ph-reflbl-max { fill: #ef4444; }
.ph-chart .ph-reflbl-min { fill: #0d9488; }


.search-panel h1{margin-top:0}.quick-toggle{display:inline-flex;align-items:center;gap:5px;border:1px solid #cbd8e5;background:white;color:#2563eb;border-radius:20px;padding:5px 11px;font-size:11px;font-weight:700;cursor:pointer}.quick-toggle .chevron{font-size:14px;line-height:10px;transition:transform .15s}.chips.expanded .quick-toggle .chevron{transform:rotate(180deg)}.chips .chip-extra{display:none}.chips.expanded .chip-extra{display:inline-block}.history{cursor:pointer;outline:none}.history:hover,.history:focus-visible{color:#0d9488}.history circle{fill:#14b8a6;stroke:white;stroke-width:1}.history svg{flex:none}.ph-body{min-height:40px}#ph-modal{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}#ph-modal .ph-card{border:1px solid #e5eaf0}#ph-modal .ph-close{width:30px;height:30px;display:grid;place-items:center;border-radius:50%}#ph-modal .ph-close:hover{background:#f1f5f9}body.modal-open{overflow:hidden}
@media(max-width:600px){.chips{flex-wrap:wrap;overflow:visible}.chips a.quick-chip{display:inline-block}.chips:not(.expanded) a.quick-chip:nth-of-type(n+3){display:none}.chips:not(.expanded){flex-wrap:nowrap}.chips.expanded a.quick-chip{display:inline-block}.quick-toggle{font-size:10px;padding:5px 9px}#ph-modal .ph-card{width:94vw;padding:16px}.ph-current{font-size:1.4rem}.ph-stat-val{font-size:.95rem}}


.product-main{display:flex;flex-direction:column;flex:1;min-width:0}.product-main .card-body{flex:1}.product-card>button.history{appearance:none;-webkit-appearance:none;display:flex;align-items:center;gap:8px;width:100%;min-height:48px;margin:0;padding:8px 13px;border:0;border-top:1px solid #edf2f5;border-radius:0;background:#fbfdfe;text-align:left;color:#64748b;cursor:pointer;font-family:inherit}.product-card>button.history:hover,.product-card>button.history:focus-visible{background:#f0fbf7;color:#0f766e;outline:none}.product-card>button.history svg{width:43px;height:18px;margin:0;flex:none}.history-low{display:flex;flex-direction:column;min-width:0;line-height:1.15}.history-low-label{font-size:8px;color:#94a3b8;margin-bottom:3px}.history-low-price{font-size:11px;font-weight:800;color:#0f766e;white-space:nowrap}.history-low-price small{font-size:8px;font-weight:500;color:#94a3b8}.product-card .card-body{padding-bottom:11px}@media(max-width:600px){.product-card>button.history{min-height:46px;padding:8px 12px}.history-low-label{font-size:8px}.history-low-price{font-size:11px}}


.product-card>button.history{gap:10px}.product-card>button.history svg{flex:1 1 0;width:0;min-width:60px;max-width:none;height:20px;margin:0}.product-card>button.history .history-low{margin-left:auto;align-items:flex-end;text-align:right;flex:none;min-width:88px}.product-card>button.history .history-low-label{display:block;text-align:right}.product-card>button.history .history-low-price{display:block;text-align:right}@media(max-width:600px){.product-card>button.history{gap:8px}.product-card>button.history svg{min-width:55px}.product-card>button.history .history-low{min-width:86px}}

.brand-icon{display:block;width:39px;height:39px;object-fit:contain}@media(max-width:600px){.brand-icon{width:35px;height:35px}}
/* Production-only behavior: real carousels, loading state and curated tiles. */
.tile-1{--tile:#e8eef9}.tile-2{--tile:#e8f5f1}.tile-3{--tile:#f1edf9}.tile-4{--tile:#fff0e8}.tile-5{--tile:#edf3f8}.tile-6{--tile:#f9edf2}
.product-row{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - 48px)/5);overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;padding-bottom:5px}.product-row::-webkit-scrollbar{display:none}.product-card{scroll-snap-align:start}.section-actions .round:disabled{opacity:.28;pointer-events:none}.product-card .product-main{min-height:0}
.product-card>button.history{min-height:58px;padding:10px 13px;background:#f2fbf7;border-top:1px solid #d9eee4}.product-card>button.history:hover,.product-card>button.history:focus-visible{background:#e5f8ef}.product-card>button.history svg{height:25px;min-width:55px}.product-card>button.history path{stroke-width:2.1}.product-card>button.history path.area{fill:#dff5ec}.product-card>button.history .history-low{min-width:100px}.product-card>button.history .history-low-label{font-size:9px;color:#526176;margin-bottom:4px}.product-card>button.history .history-low-price{font-size:12px;color:#087f68}.product-card>button.history .history-low-price small{font-size:8px;color:#526176}
.loading-screen{display:none;position:fixed;inset:0;background:rgba(15,23,42,.78);z-index:10001;align-items:center;justify-content:center;backdrop-filter:blur(4px)}.loading-content{text-align:center;color:#fff;min-width:min(340px,85vw)}.loading-spinner{width:46px;height:46px;margin:0 auto 18px;border:3px solid rgba(255,255,255,.22);border-top-color:#2dd4bf;border-radius:50%;animation:home-spin .8s linear infinite}.loading-text{font-size:16px;font-weight:650;margin-bottom:18px}.loading-progress{height:4px;background:rgba(255,255,255,.18);border-radius:8px;overflow:hidden}.loading-progress-bar{height:100%;width:0;background:#2dd4bf;transition:width .2s}@keyframes home-spin{to{transform:rotate(360deg)}}
@media(max-width:900px){.product-row{grid-auto-columns:calc((100% - 24px)/3)}.product-card:nth-child(n+4){display:flex}}
@media(max-width:600px){.product-row{display:flex;grid-auto-flow:initial;grid-auto-columns:auto;gap:10px}.product-card{display:flex!important;min-width:207px;width:207px}.section-actions .round{display:none}}
