/* Product page — phone layout (< 768px). Markup: components/product/mobile_view.php.
 * Replaces the ticket card, back link and breadcrumb on phones; the checkout card below is kept. */
.pm {
    display: none;
}

@media (max-width: 767px) {
    body .pd { padding-top: 12px; }
    body .pd__wrap { padding: 8px 16px 32px; }

    body .pd-nav,
    body .pd-ticket,
    body #quickPurchase .pd-methods {
        display: none !important;
    }

    .pm {
        --pm-line: rgba(255, 255, 255, 0.14);
        --pm-line-soft: rgba(255, 255, 255, 0.08);
        --pm-text-2: rgba(255, 255, 255, 0.55);
        --pm-surface: #0b0b0c;
        display: flex;
        flex-direction: column;
        margin-bottom: 18px;
        font-family: 'DM Sans', system-ui, sans-serif;
        color: #fff;
    }

    /* ── Top bar ── */
    .pm-top {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .pm-circle {
        flex: none;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: 1px solid var(--pm-line);
        background: transparent;
        color: #fff;
        font-size: 13px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background-color 0.3s ease, transform 0.15s ease;
    }

    .pm-circle:active { transform: scale(0.92); }
    .pm-circle.is-on { background: rgba(255, 255, 255, 0.1); }

    .pm-crumb {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        padding-inline-start: 2px;
        font-size: 13px;
        color: var(--pm-text-2);
        white-space: nowrap;
    }

    .pm-crumb a { color: inherit; }
    .pm-crumb i { font-size: 10px; }
    .pm-crumb__cur {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #fff;
    }

    html[dir="rtl"] .pm .fa-arrow-left,
    html[dir="rtl"] .pm .fa-angle-right {
        transform: scaleX(-1);
    }

    /* ── Card ── */
    .pm-stage {
        position: relative;
        height: 212px;
        margin-top: 4px;
        perspective: 900px;
        display: flex;
        align-items: center;
    }

    .pm-stage__shadow {
        position: absolute;
        left: 50%;
        bottom: 6px;
        width: 240px;
        height: 24px;
        margin-left: -120px;
        border-radius: 50%;
        background: radial-gradient(ellipse, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 70%);
    }

    .pm-card {
        position: relative;
        width: 100%;
        height: 200px;
        border-radius: 20px;
        overflow: hidden;
        transform-style: preserve-3d;
        border: 1px solid rgba(255, 255, 255, 0.22);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
        background: #111;
        animation: pmTilt 8s ease-in-out infinite;
    }

    .pm-card__bg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 70% 50%;
    }

    .pm-card__tint {
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.65) 100%);
    }

    .pm-card__sweep {
        position: absolute;
        inset: 0;
        background: linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.35) 48%, rgba(255, 255, 255, 0) 60%);
        background-size: 250% 100%;
        mix-blend-mode: screen;
        animation: pmSweep 5s ease-in-out infinite;
    }

    .pm-card__body {
        position: absolute;
        inset: 0;
        padding: 16px 18px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .pm-card__meta {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 11.5px;
    }

    .pm-card__platform { font-size: 22px; }
    .pm-card__id { color: rgba(255, 255, 255, 0.75); letter-spacing: 0.02em; }

    .pm-card__live {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    /* "LIVE" → "Live" */
    .pm-card__live-txt { display: inline-block; text-transform: lowercase; }
    .pm-card__live-txt::first-letter { text-transform: uppercase; }

    .pm-card__dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #4ade80;
        box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
    }

    .pm-card__foot {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
    }

    .pm-card__name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-family: Sora, 'Noto Sans Arabic', system-ui, sans-serif;
        font-weight: 700;
        line-height: 1.05;
        letter-spacing: -0.05em;
    }

    .pm-card__price {
        flex: none;
        font-family: Sora, 'Noto Sans Arabic', system-ui, sans-serif;
        font-size: 24px;
        font-weight: 600;
        line-height: 1;
        letter-spacing: -0.03em;
    }

    @keyframes pmTilt {
        0%, 100% { transform: rotateX(8deg) rotateY(-10deg); }
        50% { transform: rotateX(2deg) rotateY(10deg); }
    }

    @keyframes pmSweep {
        0% { background-position: -80% 0; }
        70%, 100% { background-position: 220% 0; }
    }

    /* ── Delivery options ── */
    .pm-options {
        margin-top: 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .pm-opt {
        width: 100%;
        height: 66px;
        display: flex;
        align-items: stretch;
        padding: 0;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: var(--pm-surface);
        color: #fff;
        font: inherit;
        text-align: start;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: border-color 0.3s ease, transform 0.15s ease;
    }

    .pm-opt:active { transform: scale(0.985); }
    .pm-opt.is-selected { border-color: rgba(255, 255, 255, 0.55); }

    .pm-opt__price {
        flex: none;
        width: 88px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.08);
        border-inline-end: 1px dashed rgba(255, 255, 255, 0.25);
        font-family: Sora, 'Noto Sans Arabic', system-ui, sans-serif;
        font-size: 20px;
        font-weight: 700;
        letter-spacing: -0.03em;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .pm-opt.is-selected .pm-opt__price {
        background: #fff;
        color: #0a0a0a;
    }

    .pm-opt__body {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 0 16px;
    }

    .pm-opt__title {
        display: flex;
        align-items: center;
        gap: 8px;
        font-family: Sora, 'Noto Sans Arabic', system-ui, sans-serif;
        font-size: 15px;
        font-weight: 600;
        letter-spacing: -0.02em;
    }

    .pm-opt__title i { font-size: 12px; opacity: 0.75; }

    .pm-opt__desc {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
        color: var(--pm-text-2);
    }

    /* ── Pay with: uniform 3×2 grid (2 cols when card checkout is off) ── */
    .pm-pay {
        --pm-pay-ring: #0b0b0c;
        margin-top: 12px;
        padding: 12px;
        border-radius: 18px;
        border: 1px solid var(--pm-line-soft);
        background: rgba(255, 255, 255, 0.03);
    }

    .pm-pay__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 0 2px 10px;
    }

    .pm-pay__label { font-size: 13px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; }

    .pm-pay__picked {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        font: 600 12px/1 'DM Sans', system-ui, sans-serif;
    }

    .pm-pay__picked::before {
        content: '';
        flex: none;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #4ade80;
        box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
    }

    .pm-pay__grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .pm-pay__tile {
        position: relative;
        min-width: 0;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: var(--pm-surface);
        color: #fff;
        font: 600 13px/1 'DM Sans', system-ui, sans-serif;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.15s ease;
    }

    .pm-pay__grid--duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pm-pay__tile:active { transform: scale(0.96); }
    .pm-pay__tile:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

    .pm-pay__tile.is-active {
        border-color: rgba(255, 255, 255, 0.6);
        background: rgba(255, 255, 255, 0.07);
    }

    .pm-pay__logo {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        white-space: nowrap;
        opacity: 0.82;
        transition: opacity 0.25s ease;
    }

    .pm-pay__tile.is-active .pm-pay__logo { opacity: 1; }

    .pm-pay__tick {
        position: absolute;
        top: -6px;
        inset-inline-end: -6px;
        width: 17px;
        height: 17px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #fff;
        color: #0a0a0a;
        font-size: 8px;
        box-shadow: 0 0 0 3px var(--pm-pay-ring);
        opacity: 0;
        transform: scale(0.4);
        transition: opacity 0.2s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .pm-pay__tile.is-active .pm-pay__tick { opacity: 1; transform: scale(1); }

    .pm-pay__crypto { gap: 5px; direction: ltr; }
    .pm-pay__crypto .fa-bitcoin { font-size: 21px; }
    .pm-pay__crypto .fa-ethereum { font-size: 19px; }

    .pm-pay__visa {
        font: italic 800 15px/1 Sora, 'Noto Sans Arabic', system-ui, sans-serif;
        letter-spacing: -0.01em;
    }

    .pm-pay__mc { position: relative; display: block; width: 30px; height: 19px; direction: ltr; }
    .pm-pay__mc span {
        position: absolute;
        top: 0;
        width: 19px;
        height: 19px;
        border-radius: 50%;
    }
    .pm-pay__mc span:first-child { left: 0; background: #eb001b; }
    .pm-pay__mc span:last-child { right: 0; background: rgba(247, 158, 27, 0.9); }

    .pm-pay__wallet { font-size: 34px; line-height: 1; }

    .pm-pay__paypal { gap: 6px; direction: ltr; font-family: Sora, 'Noto Sans Arabic', system-ui, sans-serif; font-style: italic; font-weight: 800; letter-spacing: -0.02em; }
    .pm-pay__paypal .fa-paypal { font-size: 15px; font-style: normal; }
    .pm-pay__paypal b { font-weight: inherit; color: rgba(255, 255, 255, 0.72); }
    .pm-pay__ext { font-size: 9px; font-style: normal; opacity: 0.5; }

    /* ── Buy ── */
    .pm-dock {
        margin-top: 22px;
        padding: 8px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .pm-buy {
        width: 100%;
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 18px;
        border: 0;
        border-radius: 18px;
        background: linear-gradient(180deg, #ffffff 0%, #d9d9de 55%, #b9b9c0 100%);
        color: #0a0a0a;
        font: 600 16px/1 Sora, 'Noto Sans Arabic', system-ui, sans-serif;
        letter-spacing: -0.02em;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 #fff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.15s ease, filter 0.2s ease;
    }

    .pm-buy:active { transform: scale(0.98); filter: brightness(0.96); }
    .pm-buy__label, .pm-buy__total { display: flex; align-items: center; gap: 10px; }
    .pm-buy__label i { font-size: 14px; }
    .pm-buy__total { gap: 8px; font-size: 17px; }
    .pm-buy__total i { font-size: 12px; }

    .pm-secure {
        margin: 10px 0 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.45);
    }

    .pm-secure i { font-size: 10px; }

}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .pm-card,
    .pm-card__sweep {
        animation: none;
    }
}
