/* English plan pages: the hero's product card (the Product schema / Merchant
   Center image, shown in its own column between the title and the price box)
   and the verified saving under the price on flash-sale plans
   (src/services/planPriceComparison.js renderHeroSaving). Layered on
   commerce-details.css; localized plan pages don't load this file. */

.plan-header .plan-header-content { gap: clamp(1.5rem, 3.5vw, 3rem) !important; }
.plan-header .plan-title { min-width: 0; }
.plan-header .plan-title h1 { text-wrap: balance; }

.plan-card-visual {
    position: relative;
    flex: 0 0 auto;
    width: clamp(150px, 16vw, 216px);
    margin: 0;
    isolation: isolate;
}

/* Soft light behind the card so it lifts off the gradient. */
.plan-card-visual::before {
    content: "";
    position: absolute;
    inset: 12% -14% -10%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(199, 210, 254, .55), rgba(199, 210, 254, 0));
    filter: blur(6px);
}

.plan-card-visual .plan-product-artwork {
    float: none;
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    border-radius: 1.35rem;
    box-shadow: 0 28px 54px -22px rgba(15, 23, 42, .7), 0 0 0 1px rgba(255, 255, 255, .22);
    transform: rotate(-4deg);
    transition: transform .35s ease;
}

.plan-header:hover .plan-card-visual .plan-product-artwork { transform: rotate(-2deg) translateY(-4px); }

/* Verified saving between the hero price and the checkout button
   (flash-sale plans only). The info button opens the source and, for
   converted currencies, the dated exchange rate. */
.plan-saving {
    position: relative;
    margin: .1rem 0 .9rem;
    border: 1px solid rgba(167, 243, 208, .5);
    border-radius: .9rem;
    background: linear-gradient(135deg, rgba(6, 95, 70, .42), rgba(4, 120, 87, .26));
    color: #ecfdf5;
    text-align: left;
    line-height: 1.35;
}

.plan-saving[hidden] { display: none; }
.plan-saving-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .55rem; padding: .65rem .6rem .65rem .7rem; }
.plan-saving-row .plan-saving-icon { margin-top: .1rem; }

.plan-saving-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #a7f3d0;
    color: #065f46;
}

.plan-saving-icon svg { width: .85rem; height: .85rem; }
.plan-saving-text { min-width: 0; flex: 1 1 auto; }
.plan-saving strong { display: block; color: #fff; font-size: .92rem; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; }
.plan-saving small { display: block; margin-top: .12rem; color: #d1fae5; font-size: .74rem; font-weight: 600; }
.plan-saving small s { text-decoration-thickness: 1.5px; text-decoration-color: rgba(209, 250, 229, .8); }
.plan-saving-pct { display: inline-block; margin-left: .2rem; padding: .05rem .4rem; font-style: normal; vertical-align: 1px; border-radius: 999px; background: #a7f3d0; color: #064e3b; font-size: .75rem; font-weight: 850; letter-spacing: -.01em; }
.plan-saving-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.plan-saving-info {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1.5px solid rgba(236, 253, 245, .7);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font: italic 800 .85rem/1 Georgia, "Times New Roman", serif;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
/* A 44px touch target without a bigger visual. */
.plan-saving-info::after { content: ""; position: absolute; inset: -.5rem; }
.plan-saving-info { position: relative; }
.plan-saving-info:hover, .plan-saving-info[aria-expanded="true"] { background: rgba(255, 255, 255, .18); border-color: #fff; }
.plan-saving-info:focus-visible { outline: 3px solid #a7f3d0; outline-offset: 2px; }

.plan-saving-more { margin: 0 .75rem .75rem; padding: .7rem .8rem; border-radius: .7rem; background: rgba(255, 255, 255, .96); color: #1f2937; font-size: .8rem; line-height: 1.5; box-shadow: 0 10px 24px -14px rgba(2, 6, 23, .6); }
.plan-saving-more[hidden] { display: none; }
.plan-saving-more p { margin: 0 0 .45rem; color: #374151; }
.plan-saving-more strong { display: inline; color: #111827; font-size: inherit; font-weight: 750; }
.plan-saving-more .plan-saving-fine { color: #6b7280; font-size: .74rem; }
.plan-saving-more a { color: #4338ca !important; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }

/* Device check and refund links: quiet, side by side. */
.plan-price .plan-price-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; margin-top: .8rem; }
.plan-price .plan-price-links .compatibility-link { display: inline; width: auto; min-height: 0; margin: 0; padding: .35rem 0; border: 0; background: none; font-size: .78rem; font-weight: 700; color: rgba(255, 255, 255, .92); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .45); text-underline-offset: 3px; }
.plan-price .plan-price-links .compatibility-link:hover { color: #fff; text-decoration-color: #fff; }

/* Tablets: a smaller card so the title keeps its room. */
@media (min-width: 768px) and (max-width: 1023px) {
    .plan-card-visual { width: 132px; }
}

/* Phones: title full width, then the benefits beside the card, then the price. */
@media (max-width: 767px) {
    .plan-header .plan-header-content {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center !important;
        column-gap: 1rem !important;
        row-gap: 0 !important;
    }
    .plan-header .plan-title { display: contents; }
    .plan-header .plan-title > * { grid-column: 1 / -1; }
    .plan-header .plan-title h1 { min-height: 0; }
    .plan-header .plan-confidence { grid-column: 1; margin-top: 1.1rem; }
    .plan-card-visual { grid-column: 2; grid-row: span 1; width: 104px; margin-top: 1.1rem; align-self: center; }
    .plan-card-visual .plan-product-artwork { border-radius: .9rem; transform: rotate(-3deg); }
    .plan-header .plan-price { grid-column: 1 / -1; margin-top: 1.25rem !important; }
    .plan-saving { margin: .55rem 0 .35rem; }
    .plan-price .plan-price-links { justify-content: flex-start; gap: .1rem 1rem; margin-top: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .plan-card-visual .plan-product-artwork { transition: none; }
    .plan-header:hover .plan-card-visual .plan-product-artwork { transform: rotate(-4deg); }
}

[dir="rtl"] .plan-card-visual .plan-product-artwork { transform: rotate(4deg); }

/* Desktop: a slightly wider price box so the saving and links read on one or two lines. */
@media (min-width: 1024px) {
    .plan-header .plan-price { flex-basis: 300px; }
}
