/* The catalogue (shared.js): companies, the capacity and colour on the cards,
   the search, the sections sheet, a device's own page. In the identity. Names
   start with ct- and pp-. */

/* The card's movement (shared.js): faint gold behind the device, one light across the instalment */
.card-media { perspective: 900px; overflow: hidden; }
.card-media .pic { position: relative; }
.ct-glow { position: absolute; inset: 10% 14%; border-radius: 50%; background: radial-gradient(circle, rgba(230, 200, 119, 0.18), rgba(230, 200, 119, 0) 70%); opacity: 0.7; pointer-events: none; }
.installment { position: relative; overflow: hidden; }
.ct-sheen { position: absolute; top: 0; bottom: 0; right: 0; width: 40%; background: linear-gradient(100deg, rgba(230, 200, 119, 0), rgba(230, 200, 119, 0.26), rgba(230, 200, 119, 0)); opacity: 0; pointer-events: none; }
.card .btn { transition: transform 0.12s ease; }
.card .btn:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) {
    .card .btn { transition: none; }
    .card .btn:active { transform: none; }
}

/* The flight: the card's photo to the device's page and back */
::view-transition-group(ct-device) { animation-duration: 0.46s; animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1); }
::view-transition-old(ct-device), ::view-transition-new(ct-device) { height: 100%; object-fit: contain; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.24s; }

/* Companies within a section */
.companies { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.companies::-webkit-scrollbar { display: none; }
.companies[hidden] { display: none; }
.ct-company { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.ct-company.is-on { color: var(--gold); border-color: rgba(230, 200, 119, 0.6); background: rgba(230, 200, 119, 0.08); }

.search-note { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.search-note[hidden] { display: none; }

/* Capacity and colour */
.ct-caps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.ct-chip { border: 1px solid var(--line); background: #15262f; color: var(--ink); border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 700; cursor: pointer; direction: ltr; }
.ct-chip.is-on { border-color: var(--gold); color: var(--gold); background: rgba(230, 200, 119, 0.1); }
.ct-colours { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.ct-dot { --dot: #888; width: 20px; height: 20px; border-radius: 50%; background: var(--dot); border: 2px solid rgba(255, 255, 255, 0.25); cursor: pointer; padding: 0; }
.ct-dot.is-on { outline: 2px solid var(--gold); outline-offset: 2px; }

.ct-link { cursor: pointer; }

/* «الأقسام»: a sheet from the bottom */
.ct-sheet-shade { position: fixed; inset: 0; z-index: 62; background: rgba(2, 6, 8, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.ct-sheet { width: min(640px, 100%); max-height: 80vh; overflow-y: auto; background: #0d1a21; border-top: 1px solid rgba(230, 200, 119, 0.3); border-radius: 22px 22px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); animation: ct-up 0.22s ease; }
@keyframes ct-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ct-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ct-sheet-head h2 { margin: 0; font-family: Alexandria, var(--font); font-size: 22px; }
.ct-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ct-section { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 16px 10px; border-radius: 16px; border: 1px solid var(--line); color: var(--ink); cursor: pointer;
    background: url("img/petals.svg") center 120% / 140% auto no-repeat, #101e26; }
.ct-section:hover { border-color: rgba(230, 200, 119, 0.55); }
.ct-section-icon { font-size: 30px; }
.ct-section b { font-family: Alexandria, var(--font); font-size: 15px; }
.ct-section small { color: var(--muted); }

/* A device's own page */
.pp { position: fixed; inset: 0; z-index: 55; overflow-y: auto; background: radial-gradient(120% 70% at 50% 0%, #13232c 0%, #0b161c 55%); }
.pp[hidden] { display: none; }
body.pp-open { overflow: hidden; }
.pp-inner { width: min(980px, 100% - 28px); margin: 0 auto; padding: 14px 0 120px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.pp-top { grid-column: 1 / -1; display: flex; justify-content: space-between; }
.pp-back, .pp-share { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.pp-share { color: var(--gold); border-color: rgba(230, 200, 119, 0.5); }
.pp-media { height: 440px; border-radius: 22px; }
.pp-media .pic-has-photo { padding: 0; }
.pp-media .pic-photo { max-width: 62%; max-height: 72%; }
.pp-media .pic-phone { transform: scale(1.8); }
.pp-body { display: grid; gap: 10px; align-content: start; padding-top: 10px; }
.pp-brand { margin: 0; color: var(--gold); font-weight: 600; }
.pp-name { margin: 0; font-family: Alexandria, var(--font); font-size: clamp(28px, 4vw, 42px); line-height: 1.1; direction: ltr; text-align: right; }
.pp-variant { margin: 0; color: var(--muted); min-height: 1em; }
.pp-body .ct-chip { font-size: 14px; padding: 7px 14px; }
.pp-body .ct-dot { width: 26px; height: 26px; }
.pp-price { margin: 8px 0 0; font-size: 16px; color: var(--muted); }
.pp-price b { font-family: Alexandria, var(--font); font-size: 34px; color: var(--ink); }
.pp-month { margin: 0; color: var(--gold); font-weight: 600; }
.pp-perks { list-style: none; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 8px; font-size: 14px; background: rgba(16, 30, 38, 0.7); }
.pp-actions { display: flex; gap: 10px; }
.pp-actions .btn { flex: 1; min-height: 50px; }

@media (max-width: 760px) {
    .pp-inner { grid-template-columns: 1fr; gap: 14px; }
    .pp-media { height: 330px; }
    .pp-actions { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* The golden warranty: the banner on the home page, the box on a used device's page */
.gd-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 26px;
    padding: 22px 26px;
    border-radius: 20px;
    border: 1px solid rgba(230, 200, 119, 0.45);
    background: url("img/petals-quiet.svg") left -40px bottom -60px / 360px auto no-repeat, linear-gradient(120deg, #13232c, #0d1a21);
}
.gd-banner h2 { margin: 2px 0 6px; font-family: Alexandria, var(--font); font-size: clamp(24px, 3.4vw, 34px); color: #fbe7a6; }
.gd-banner p { margin: 0; color: #cdd5da; }
.gd-banner b { color: var(--gold); }
.gd-banner-kicker { color: var(--gold) !important; font-weight: 600; font-size: 13px; }
.gd-banner .btn { flex: none; }

.pp-golden { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(230, 200, 119, 0.5); background: rgba(230, 200, 119, 0.07); text-decoration: none; color: var(--ink); }
.pp-golden b { font-family: Alexandria, var(--font); color: #fbe7a6; }
.pp-golden span { color: #cdd5da; font-size: 14px; }

@media (max-width: 760px) {
    .gd-banner { flex-direction: column; align-items: flex-start; }
}
.gd-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }
