:root {
    --cyan: #22d8ff;
    --blue: #599cff;
    --panel: #0d141f;
    --line: #203347;
    --muted: #91a7b7;
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    background: radial-gradient(circle at 80% 0, rgba(34, 216, 255, 0.08), transparent 28%), #060910;
    color: #f7f9fc;
    font-family: Cairo, "Segoe UI", sans-serif;
}
button,
input,
textarea {
    font: inherit;
}
a {
    color: inherit;
    text-decoration: none;
}
.wrap {
    width: min(1180px, calc(100% - 28px));
    margin: auto;
}
.top {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bdeeff;
}
.store-name {
    font-weight: 900;
    color: var(--cyan);
}
.product {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 26px;
    background: linear-gradient(145deg, rgba(15, 24, 37, 0.96), rgba(7, 11, 18, 0.98));
    border: 1px solid var(--line);
    border-radius: 30px;
    padding: 22px;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.4);
}
.media-stage {
    position: relative;
    display: grid;
    place-items: center;
    height: 560px;
    border-radius: 22px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, rgba(34, 216, 255, 0.12), transparent 36%),
        linear-gradient(145deg, #111d2a, #080c13);
    cursor: zoom-in;
}
.media-stage:after {
    content: "اضغط لتكبير الصور";
    position: absolute;
    bottom: 14px;
    right: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(2, 6, 10, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    color: #d9f7ff;
}
.main-img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    filter: drop-shadow(0 30px 28px rgba(0, 0, 0, 0.55));
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.media-stage:hover .main-img {
    transform: scale(1.035) rotate(-1deg);
}
.thumbs {
    display: flex;
    gap: 9px;
    margin-top: 10px;
    overflow: auto;
    padding: 3px;
}
.thumb {
    flex: 0 0 76px;
    height: 76px;
    padding: 4px;
    border-radius: 14px;
    border: 2px solid transparent;
    background: #101a26;
    cursor: pointer;
}
.thumb.active {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 216, 255, 0.1);
}
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}
.info {
    padding: 10px 5px;
}
.eyebrow {
    color: var(--cyan);
    font-weight: 800;
}
.info h1 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.15;
    margin: 8px 0 12px;
}
.tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.tag {
    padding: 7px 10px;
    background: #172432;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    color: #c5d7e3;
}
.price {
    font-size: 36px;
    font-weight: 900;
    margin: 20px 0;
    background: linear-gradient(90deg, #fff, var(--cyan));
    -webkit-background-clip: text;
    color: transparent;
}
.options-title {
    margin: 0 0 10px;
    font-size: 15px;
    color: #d9e6ee;
}
.options {
    display: grid;
    gap: 9px;
}
.option {
    position: relative;
    display: grid;
    grid-template-columns: 28px 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #284157;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.22s;
}
.option input {
    position: absolute;
    opacity: 0;
}
.option:has(input:checked) {
    border-color: var(--cyan);
    background: #102331;
    box-shadow: 0 0 0 3px rgba(34, 216, 255, 0.08);
}
.option.sold {
    opacity: 0.4;
    cursor: not-allowed;
}
.swatch {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: var(--swatch);
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55);
}
.variant-color {
    font-weight: 800;
}
.stock {
    font-size: 12px;
    color: #68e7ac;
}
.sold .stock {
    color: #ff8995;
}
.buy {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
.buy textarea,
.buy button,
.buy input {
    width: 100%;
    border: 1px solid #294156;
    background: #111c28;
    color: #fff;
    border-radius: 13px;
    padding: 13px;
}
.buy textarea,
.buy button,
.buy #message {
    grid-column: 1/-1;
}
.buy button {
    border: 0;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #00131b;
    font-weight: 900;
    font-size: 17px;
    cursor: pointer;
}
.buy button:hover {
    filter: brightness(1.08);
}
#message {
    min-height: 24px;
    color: #7cecb4;
}
.spec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 26px 0;
}
.spec {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}
.spec small {
    display: block;
    color: #7991a3;
    margin-bottom: 5px;
}
.related {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 50px;
}
.related a {
    background: var(--panel);
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.related img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
}
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    background: rgba(0, 3, 8, 0.91);
    backdrop-filter: blur(10px);
    padding: 24px;
}
.lightbox.open {
    display: grid;
    grid-template-rows: 1fr auto;
    animation: fade 0.2s ease;
}
.lightbox-main {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
}
.lightbox-image {
    max-width: min(880px, 82vw);
    max-height: 78vh;
    object-fit: contain;
    filter: drop-shadow(0 30px 55px #000);
    animation: zoom 0.28s ease;
}
.lightbox-close,
.lightbox-arrow {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(5, 9, 14, 0.78);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.lightbox-close {
    top: 0;
    left: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 25px;
}
.lightbox-arrow {
    top: 50%;
    translate: 0 -50%;
    width: 52px;
    height: 64px;
    border-radius: 15px;
    font-size: 32px;
}
.lightbox-next {
    left: 12px;
}
.lightbox-prev {
    right: 12px;
}
.lightbox-thumbs {
    direction: ltr;
    display: flex;
    justify-content: center;
    gap: 8px;
    overflow: auto;
    padding: 10px;
}
.lightbox-thumb {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 3px;
    background: #111;
    cursor: pointer;
}
.lightbox-thumb.active {
    border-color: var(--cyan);
}
.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 7px;
}
@keyframes fade {
    from {
        opacity: 0;
    }
}
@keyframes zoom {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
}
@media (max-width: 780px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    .wrap {
        width: 100%;
        max-width: none;
        padding-inline: 10px;
    }
    .top {
        width: 100%;
        height: 58px;
    }
    .store-name {
        max-width: 50%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .product {
        display: block;
        width: 100%;
        min-width: 0;
        padding: 10px;
        border-radius: 20px;
    }
    .gallery,
    .info {
        width: 100%;
        min-width: 0;
    }
    .media-stage {
        width: 100%;
        height: min(390px, 92vw);
        padding: 0;
        border-radius: 16px;
    }
    .main-img {
        width: 82%;
        height: 82%;
    }
    .thumbs {
        width: 100%;
        max-width: 100%;
        padding-bottom: 7px;
    }
    .thumb {
        flex-basis: 64px;
        height: 64px;
    }
    .info {
        padding: 14px 2px 4px;
    }
    .info h1 {
        font-size: clamp(27px, 9vw, 36px);
    }
    .price {
        font-size: clamp(27px, 9vw, 36px);
        margin: 14px 0;
    }
    .option {
        width: 100%;
        grid-template-columns: 26px minmax(0, 1fr) auto;
        padding: 11px 9px;
        gap: 7px;
    }
    .option .ram {
        display: none;
    }
    .variant-color {
        font-size: 12px;
    }
    .stock {
        font-size: 10px;
    }
    .buy {
        width: 100%;
        grid-template-columns: 1fr;
    }
    .buy textarea,
    .buy button,
    .buy input {
        min-width: 0;
    }
    .spec-grid {
        width: 100%;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }
    .spec {
        min-width: 0;
        padding: 11px;
        font-size: 12px;
    }
    .related {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }
    .related a {
        min-width: 0;
        padding: 8px;
        font-size: 11px;
    }
    .lightbox {
        padding: 8px;
    }
    .lightbox-image {
        max-width: 94vw;
        max-height: 72vh;
    }
    .lightbox-arrow {
        width: 42px;
        height: 54px;
    }
    .lightbox-prev {
        right: 2px;
    }
    .lightbox-next {
        left: 2px;
    }
}
@media (max-width: 380px) {
    .wrap {
        padding-inline: 7px;
    }
    .product {
        padding: 7px;
    }
    .media-stage {
        height: 88vw;
    }
    .spec-grid {
        grid-template-columns: 1fr;
    }
    .related {
        gap: 7px;
    }
}
.lightbox {
    background: rgba(1, 5, 9, 0.68);
    backdrop-filter: blur(3px) saturate(0.72);
}
.lightbox-image {
    background: transparent;
    filter: drop-shadow(0 34px 38px rgba(0, 0, 0, 0.72));
}
