/* iPhone comparison page */

.compare-hero,
.compare-help {
    max-width: 1180px;
    margin: 18px auto 0;
    padding: clamp(24px, 3.5vw, 42px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    border-radius: var(--radius-sm);
    background:
        radial-gradient(circle at 0% 0%, rgba(35,88,246,.10), transparent 32%),
        radial-gradient(circle at 100% 0%, rgba(255,122,0,.08), transparent 28%),
        linear-gradient(180deg, #fff, #f8fbff);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.compare-hero h1,
.compare-help h2 {
    margin: 0 0 12px;
    color: var(--dark);
    font-family: Manrope, Inter, sans-serif;
    font-size: clamp(36px, 5vw, 70px);
    line-height: .98;
    letter-spacing: -.07em;
}

.compare-hero p,
.compare-help p {
    max-width: 720px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.compare-toolbar {
    margin-top: 18px;
}

.compare-toggle {
    min-height: 46px;
    padding: 8px 14px 8px 10px;
    gap: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(17,26,54,.09);
    box-shadow: 0 10px 24px rgba(17,26,54,.055);
    color: var(--dark);
    font-size: 14px;
    line-height: 1;
    user-select: none;
}

.compare-toggle input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 40px;
    height: 24px;
    margin: 0;
    flex: 0 0 40px;
    border-radius: 999px;
    border: 1px solid rgba(17,26,54,.14);
    background: #e9edf5;
    box-shadow: inset 0 1px 2px rgba(17,26,54,.08);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.compare-toggle input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(17,26,54,.18);
    transition: transform .18s ease;
}

.compare-toggle input:checked {
    background: var(--blue);
    border-color: var(--blue);
}

.compare-toggle input:checked::after {
    transform: translateX(16px);
}

.compare-toggle:focus-within {
    outline: 3px solid rgba(35,88,246,.16);
    outline-offset: 2px;
}

.iphone-compare {
    max-width: 1180px;
    margin: 22px auto 0;
    padding: clamp(14px, 1.8vw, 22px);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    color: var(--dark);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.iphone-compare__columns,
.compare-section__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.compare-device {
    min-width: 0;
    padding: 16px 18px 18px;
    display: grid;
    justify-items: center;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(35,88,246,.07), transparent 32%),
        #ffffff;
    border: 1px solid rgba(17,26,54,.075);
    box-shadow: 0 12px 28px rgba(17,26,54,.055);
}

.compare-device__select-label {
    width: 100%;
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.compare-device select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(17,26,54,.10);
    background: #f7f9fd;
    color: var(--dark);
    font-weight: 900;
    outline: none;
}

.compare-device__image-wrap {
    position: relative;
    width: min(210px, 100%);
    height: 150px;
    margin: 16px auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    border: 0;
    overflow: visible;
}

.compare-device__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(17,26,54,.14));
}

.compare-device__placeholder {
    display: none;
    position: absolute;
    inset: 12px;
    place-items: center;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(17,26,54,.18);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.35;
}

.compare-device__image-wrap.is-missing img {
    display: none;
}

.compare-device__image-wrap.is-missing .compare-device__placeholder {
    display: grid;
}

.compare-device h2 {
    margin: 4px 0 6px;
    color: var(--dark);
    text-align: center;
    font-size: clamp(20px, 2.1vw, 30px);
    line-height: 1.08;
    letter-spacing: -.05em;
}

.compare-device p {
    min-height: 38px;
    margin: 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.35;
}

.compare-device__colors {
    margin-top: 13px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.compare-device__colors button {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(17,26,54,.16);
    background: var(--swatch);
    cursor: pointer;
}

.compare-device__colors button.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 3px var(--blue), 0 6px 14px rgba(35,88,246,.18);
}

.compare-device__color-name {
    margin-top: 8px;
    min-height: 28px;
    display: block;
    color: var(--dark);
    text-align: center;
    font-size: 12px;
}

.compare-device__buy {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: var(--blue);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(35,88,246,.18);
}

.iphone-compare__specs {
    margin-top: 24px;
}

.compare-section {
    padding-top: 22px;
    margin-top: 22px;
    border-top: 1px solid rgba(17,26,54,.08);
}

.compare-section h2 {
    margin: 0 0 18px;
    color: var(--dark);
    text-align: center;
    font-family: Manrope, Inter, sans-serif;
    font-size: clamp(24px, 3vw, 38px);
    letter-spacing: -.05em;
}

.compare-section__cell {
    padding: 0 10px;
    text-align: center;
    color: var(--dark);
    font-weight: 900;
}

.compare-section__cell p {
    margin: 0 0 13px;
    line-height: 1.35;
}

.compare-section__cell p:first-child {
    font-size: 17px;
}

.compare-section__cell p:not(:first-child) {
    color: #33415f;
    font-size: 14px;
    font-weight: 850;
}

.compare-help {
    margin-bottom: 12px;
}

.compare-help h2 {
    font-size: clamp(30px, 4vw, 52px);
}

@media (max-width: 900px) {
    .compare-hero,
    .compare-help {
        max-width: none;
        grid-template-columns: 1fr;
        border-radius: 24px;
    }

    .compare-hero .button,
    .compare-help .button {
        width: 100%;
    }

    .compare-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .iphone-compare {
        max-width: none;
        padding: 12px;
        border-radius: 24px;
        overflow-x: auto;
    }

    .iphone-compare__columns,
    .compare-section__grid {
        grid-template-columns: repeat(3, minmax(214px, 1fr));
        min-width: 692px;
        gap: 12px;
    }

    .compare-device {
        padding: 12px;
        border-radius: 20px;
    }

    .compare-device__image-wrap {
        width: min(190px, 100%);
        height: 140px;
        margin: 14px auto 8px;
    }

    .compare-device h2 {
        font-size: 21px;
    }

    .compare-section__cell {
        font-size: 13px;
    }
}
