/* Shared mobile text roles for all pages using the shop layout, including dialogs.
   Headings: 16/700; body and notes: 14/300; actions and prices: 16/600;
   text badges: 12/600. Icons and header counters retain their own dimensions. */
body.shop-ui {
    --shop-offer-title-size: 18px;
    --shop-offer-title-weight: 600;
}

@media (max-width: 767px) {
    /* Cart page hierarchy and persistent checkout summary. */
    body.shop-ui main .cart-page .cart-page-title {
        font-size: 24px !important;
        font-weight: 700 !important;
        color: #24282b !important;
        line-height: 1.25;
    }
    body.shop-ui main .cart-page .cart-section-heading { font-size: 18px !important; }
    body.shop-ui main .cart-page .cart-checkout-dock-total { font-size: 14px; font-weight: 500; }
    body.shop-ui main .cart-page .cart-checkout-dock-total strong { font-size: 24px; font-weight: 700; }
    body.shop-ui main .cart-page .cart-single-details > div { font-size: 16px !important; font-weight: 700 !important; }
    body.shop-ui main .cart-page :is(.cart-product-paper, .cart-product-surface, .cart-product-effect) { font-size: 14px !important; font-weight: 400 !important; }
    body.shop-ui main .cart-page .cart-single-price > div { font-size: 16px !important; font-weight: 600 !important; }

    body.shop-ui {
        --shop-offer-title-size: 16px;
        --shop-mobile-title-size: 16px;
        --shop-mobile-page-title-size: 24px;
        --shop-mobile-page-title-weight: 700;
        --shop-mobile-heading-size: 16px;
        --shop-mobile-body-size: 14px;
        --shop-mobile-note-size: 14px;
        --shop-mobile-body-weight: 300;
        --shop-mobile-heading-weight: 700;
        --shop-mobile-badge-size: 12px;
        --shop-mobile-badge-radius: 8px;
        --shop-mobile-primary-action-size: 14px;
        --shop-mobile-primary-action-weight: 600;
        font-family: 'Poppins', sans-serif;
    }

    body.shop-ui :is(main, .modal, footer) {
        font-size: var(--shop-mobile-body-size);
        font-weight: var(--shop-mobile-body-weight);
        line-height: 1.5;
        letter-spacing: normal;
    }

    /* Bridge existing desktop utility classes to mobile text roles. */
    body.shop-ui :is(main, .modal, footer) :is(
        p, small, .small, .form-label, .form-check-label, .form-text,
        .alert, .campaign-offer-cart-tiers, .cart-code-toggle,
        [class*="fs-photog-"], .shop-type-body
    ) {
        font-size: var(--shop-mobile-body-size) !important;
        font-weight: var(--shop-mobile-body-weight) !important;
        line-height: 1.5;
        letter-spacing: normal;
    }

    body.shop-ui :is(main, .modal, footer) :is(
        .fs-photog-13-500, .fs-photog-14-500, .fs-photog-15-500,
        .fs-photog-16-500, .fs-photog-12-600, .fs-photog-14-600,
        .fs-photog-15-600, .fs-photog-16-600, .shop-type-price
    ) {
        font-size: var(--shop-mobile-heading-size) !important;
        font-weight: 600 !important;
        line-height: 1.4;
    }

    body.shop-ui :is(main, .modal, footer) :is(
        h1, h2, h3, h4, h5, h6, .section-label, .section-head,
        .shop-welcome-title, .campaign-offer-title, .fs-head2, :where(#download-selected-name),
        .fs-photog-20-700, .fs-photog-24-600, .fs-photog-24-800,
        .campaign-offer-cart-heading, .shop-type-heading
    ) {
        font-size: var(--shop-mobile-heading-size) !important;
        font-weight: var(--shop-mobile-heading-weight) !important;
        line-height: 1.35;
        letter-spacing: normal;
        text-transform: none;
    }

    body.shop-ui :is(main, .modal, footer) :is(.btn, .gallery-filter-pill, .shop-type-action) {
        font-size: var(--shop-mobile-heading-size) !important;
        font-weight: 600 !important;
        letter-spacing: normal;
    }

    /* Gallery mobile hierarchy: title 24/700, hint 14/400, filters 13/600.
       Keep these exceptions scoped to the gallery; desktop uses its view styles. */
    body.shop-ui main .shop-gallery-content .gallery-title-group {
        display: block;
    }

    body.shop-ui main .shop-gallery-content > .d-flex {
        margin-bottom: 12px !important;
    }

    body.shop-ui main .shop-gallery-content .gallery-instructions {
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 1.5;
        margin: 4px 0 0 !important;
    }

    body.shop-ui main .shop-gallery-content .gallery-filter-pill {
        font-size: 13px !important;
        line-height: 20px;
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
    }

    body.shop-ui main .gallery-cta-btn {
        border-radius: 12px !important;
    }

    /* Download progress and instructions follow the gallery's compact hint role. */
    body.shop-ui main #downloads :is(.download-filter-status, #download-filter-empty, .download-selection-hint) {
        font-size: 12px !important;
        font-weight: 400 !important;
        line-height: 1.5;
    }

    body.shop-ui main #downloads :is(#download-purchase-count, .download-full-scope) {
        font-size: 14px !important;
        font-weight: 600 !important;
    }

    /* Page titles must outrank the generic heading bridge above. */
    body.shop-ui main .shop-page-subtitle {
        margin: 4px 0 0;
        font-size: 14px !important;
        font-weight: 400 !important;
        color: #6b7280;
        line-height: 1.5;
    }

    body.shop-ui :is(main, .modal, footer) .shop-page-title,
    body.shop-ui :is(main, .modal, footer) .shop-section-title,
    body.shop-ui main .shop-gallery-content h4.fw-semibold {
        font-size: var(--shop-mobile-page-title-size) !important;
        font-weight: var(--shop-mobile-page-title-weight) !important;
        line-height: 1.25 !important;
        color: var(--bs-body-color, #212529);
        letter-spacing: normal;
        text-transform: none;
    }

    body.shop-ui :is(main, .modal, footer) :is(
        #totalAmountGross, #totalPrice, #download-selected-price,
        .package-card-price-main, .shop-type-price
    ) {
        font-size: var(--shop-mobile-heading-size) !important;
        font-weight: 600 !important;
        line-height: 1.4;
    }

    body.shop-ui :is(main, .modal, footer) :is(.badge, .campaign-offer-tier) {
        font-size: var(--shop-mobile-badge-size) !important;
        font-weight: 600 !important;
        line-height: 16px;
        letter-spacing: normal;
        border-radius: var(--shop-mobile-badge-radius) !important;
    }

    body.shop-ui :is(main, .modal, footer) .campaign-offer-tier :is(strong, span) {
        font-size: inherit;
        line-height: inherit;
    }

    body.shop-ui main .shop-section-title .shop-section-photo-count {
        font-size: 14px !important;
        font-weight: 400 !important;
        color: #6b7280;
        white-space: nowrap;
    }

    /* Compact direct product choices retain generous touch targets. */
    body.shop-ui main label.btn.shop-product-choice {
        font-size: 12px !important;
        font-weight: 400 !important;
        color: #6b7280;
        line-height: 1.4;
        min-height: 56px;
        padding: 8px;
        white-space: normal;
    }

    body.shop-ui main .shop-product-choice .shop-product-choice-details {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px 8px;
        margin-top: 3px;
    }

    body.shop-ui main .shop-product-choice .shop-product-choice-price {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: var(--bs-body-color, #212529);
        line-height: 1.4;
    }

    body.shop-ui main .shop-product-choice .badge {
        position: static !important;
        transform: none !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        line-height: 14px;
        padding: 2px 5px;
        border-radius: 6px !important;
        white-space: nowrap;
    }

    /* Match the mobile greeting to the access-code entry heading. */
    body.shop-ui main.shop-email-entry .collect-email-title {
        font-size: 22px !important;
        font-weight: 600 !important;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    /* Preserve inline emphasis inside body copy instead of flattening its meaning. */
    body.shop-ui main.shop-email-entry .collect-email-welcome-body {
        font-size: 16px !important;
    }

    body.shop-ui main.shop-email-entry .campaign-offer-validity,
    body.shop-ui main.shop-email-entry .campaign-offer-entry-automatic {
        font-size: 12px !important;
    }

    body.shop-ui main.shop-email-entry .campaign-offer-title {
        font-size: 18px !important;
        font-weight: 700 !important;
        line-height: 1.2;
    }

    body.shop-ui :is(main, .modal, footer) :is(strong, b) {
        font-weight: 600;
    }

    body.shop-ui #cart-checkout-form .form-check-label {
        font-size: var(--shop-mobile-body-size) !important;
        font-weight: var(--shop-mobile-body-weight) !important;
    }

    body.shop-ui #download-cart-footer [aria-hidden="true"] {
        font-size: var(--shop-mobile-heading-size) !important;
    }
}

/* Primary shop actions: semantic class plus existing primary button variants.
   Typography only: preserve each control's dimensions and touch target. */
@media (max-width: 767px) {
    body.shop-ui :is(main, .modal, footer) :is(
        .shop-primary-action,
        .btn.btn-photogColour,
        .btn.btn-primary,
        .btn.btn-primary-tenant,
        .btn-text.btn-text-primary
    ) {
        font-size: var(--shop-mobile-primary-action-size) !important;
        font-weight: var(--shop-mobile-primary-action-weight) !important;
    }
}

/* Shared confirmation role overrides the generic mobile heading defaults. */
body.shop-ui :is(main, .modal, footer) :is(h1, h2, h3).shop-confirmation-title {
    font-family: 'Poppins', sans-serif;
    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
}
/* Package overview: distinguish package names and totals from body text. */
@media (max-width: 767px) {
    body.shop-ui main #fotopakete .package-card-title {
        font-size: var(--shop-mobile-page-title-size, 24px) !important;
        font-weight: var(--shop-mobile-page-title-weight, 700) !important;
        line-height: 1.25 !important;
    }
    body.shop-ui main #fotopakete .package-card-price {
        font-size: 20px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
    }
}

body.shop-ui main #fotopakete .package-download-script { font-family: 'Caveat', cursive; font-size: 26px !important; font-weight: 600 !important; line-height: 1.1 !important; color: var(--tenant-primary-color); }

/* Product composition labels are quieter than package titles. */
@media (max-width: 767px) {
    body.shop-ui main #fotopakete .package-composition .package-product-caption {
        font-size: 13px !important;
        font-weight: 600 !important;
        line-height: 1.35;
    }
    body.shop-ui main #fotopakete .package-composition .package-product-note {
        font-size: 11px !important;
        font-weight: 400 !important;
        line-height: 1.4;
    }
    body.shop-ui main #fotopakete .package-product-group .badge {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }
    body.shop-ui main #fotopakete .package-download-tile > .package-product-caption {
        font-size: 17px !important;
        font-weight: 600 !important;
        line-height: 1.3;
    }
    body.shop-ui main #fotopakete .package-download-tile > .package-product-note {
        font-family: 'Caveat', cursive;
        font-size: 23px !important;
        font-weight: 600 !important;
        line-height: 1.1;
        margin-top: 3px;
    }
}

/* Email entry uses a consistent text size; icons retain their own dimensions. */
body.shop-ui main.shop-email-entry .collect-email-card :is(h1, h2, h3, p, label, input, button, summary, small, a, strong, span:not([aria-hidden="true"])):not(.collect-email-purpose-title),
body.shop-ui main.shop-email-entry .collect-email-card #emailForm :is(h1, h2, h3, p, label, input, button, small, a, strong, span:not([aria-hidden="true"])):not(.collect-email-purpose-title) {
    font-size: 14px !important;
}

/* Keep the introductory heading above the uniform body-text size. */
body.shop-ui main.shop-email-entry .collect-email-card #emailForm .collect-email-purpose-title {
    font-size: 22px !important;
}

/* Stronger category headings distinguish sections from package names on phones. */
@media (max-width: 767px) {
    body.shop-ui main.shop-overview [data-shop-section] :is(.shop-section-title, [data-section-heading]) {
        font-size: 26px !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
    }
    body.shop-ui main.shop-overview #fotopakete .package-card-title {
        font-size: 20px !important;
        font-weight: 600 !important;
        line-height: 1.35 !important;
    }
}
