/* ==========================================================================
   Pipsqueak! Stickers - Design System (Figma V2)
   A playful-premium aesthetic for custom pet stickers
   ========================================================================== */

/* --------------------------------------------------------------------------
   Registered Custom Properties (enables gradient-position animation)
   -------------------------------------------------------------------------- */
@property --sheen-pos {
    syntax: '<percentage>';
    inherits: false;
    initial-value: -15%;
}

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Primary Palette */
    --color-primary: #E8785A;
    --color-primary-light: #F5A490;
    --color-primary-dark: #D45E3E;
    --color-primary-bg: #FFF5F2;

    /* Button Colors */
    --color-teal: #13baa0;
    --color-teal-dark: #0e9a85;
    --color-orange: #ffb048;
    --color-orange-light: #ffbe5e;
    --color-orange-dark: #e89c30;
    --color-orange-ledge: #e89530;
    --color-blue-border: #005ac8;

    /* Neutrals - Warm Cream */
    --color-cream: #FFFAF7;
    --color-cream-dark: #F5EDE8;
    --color-sand: #E8DDD5;
    --color-stone: #C4B5A9;

    /* Text Colors */
    --color-text: #3D3229;
    --color-text-secondary: #5b6d83;
    --color-text-muted: #a99e93;

    /* Accent Colors */
    --color-success: #6DB584;
    --color-warning: #E9A84B;
    --color-danger: #D95D5D;
    --color-gold: #f1cd94;
    --color-divider: #CAC4D0;
    --color-commitment-red: #bf2e1a;

    /* Typography */
    --font-display: 'Londrina Solid', Georgia, serif;
    --font-body: 'Londrina Solid', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-ui: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-tagline: 'Lilita One', sans-serif;
    --font-serif: 'Lora', serif;
    --font-content: 'Arvo', Georgia, serif;
    --font-system: Arial, Helvetica, sans-serif;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(61, 50, 41, 0.06);
    --shadow-md: 0 4px 16px rgba(61, 50, 41, 0.08);
    --shadow-lg: 0 8px 32px rgba(61, 50, 41, 0.12);
    --shadow-xl: 0 16px 48px rgba(61, 50, 41, 0.16);
    --shadow-card: 0px 4px 16px rgba(61, 50, 41, 0.78);

    /* Transitions */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    background-color: #f6f5fd;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background: transparent;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    position: relative;
}

/* --------------------------------------------------------------------------
   Background Pattern
   -------------------------------------------------------------------------- */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -5;
    background-image: url('../images/optimized/background-patches-600w.png');
    background-image: image-set(
        url('../images/optimized/background-patches-600w.webp') type('image/webp'),
        url('../images/optimized/background-patches-600w.png') type('image/png')
    );
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (min-width: 900px) {
    .bg-pattern {
        background-image: url('../images/optimized/background-patches-1024w.png');
        background-image: image-set(
            url('../images/optimized/background-patches-1024w.webp') type('image/webp'),
            url('../images/optimized/background-patches-1024w.png') type('image/png')
        );
    }
}

/* --------------------------------------------------------------------------
   Container & Layout
   -------------------------------------------------------------------------- */
.container {
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-md);
    position: relative;
    z-index: 1;
}

/* Container: Tablet (640px+) */
@media (min-width: 640px) {
    .container {
        max-width: 600px;
        padding: var(--space-lg);
    }
}

/* Container: iPad Portrait (768px+) */
@media (min-width: 768px) {
    .container {
        max-width: 700px;
        padding: var(--space-xl);
    }
}

/* Container: Desktop (900px+) */
@media (min-width: 900px) {
    .container {
        max-width: 1000px;
    }
}

/* Container: Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1210px;
        padding: var(--space-3xl);
    }
}

/* --------------------------------------------------------------------------
   Section Styles
   -------------------------------------------------------------------------- */
.section {
    position: relative;
    margin-bottom: var(--space-md);
    animation: fadeInUp 0.5s var(--ease-smooth);
    animation-fill-mode: both;
}

.section:nth-child(2) {
    animation-delay: 0.1s;
}

.section:nth-child(3) {
    animation-delay: 0.2s;
}

.section:nth-child(4) {
    animation-delay: 0.3s;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xs);
}

/* Section Sign Images */
.section-sign {
    max-width: 280px;
    width: 100%;
    height: auto;
    margin-bottom: var(--space-xs);
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 400;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 31px;
}

.section-subtitle-dark {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: var(--space-sm);
}

/* Step 1 card (Figma: white card with blue border) */
.section-card-upload {
    background: white;
    border: 2px solid var(--color-blue-border);
    border-radius: var(--radius-xl);
    padding: var(--space-md) var(--space-md) var(--space-lg);
    box-shadow: 0px 2px 8px rgba(61, 50, 41, 0.15);
    position: relative;
}

/* Section title text (replaces image-based titles) */
.section-title-text {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 400;
    color: black;
    text-align: center;
    line-height: 1;
    margin: 0;
}

/* Upload sign image (Figma) — legacy, kept for compat */
.upload-sign-img {
    max-width: 232px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 2px;
}

/* Reset header margin inside theme section (flex gap handles spacing) */
.section-card-blue .section-header {
    margin-bottom: 0;
}

/* Blue top/bottom band for theme section */
.section-card-blue {
    background: white;
    border: none;
    border-top: 2px solid var(--color-blue-border);
    border-bottom: 2px solid var(--color-blue-border);
    border-radius: 0;
    padding: 16px 17px 17px;
    box-shadow: 0px 0px 4px 2px rgba(61, 50, 41, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* --------------------------------------------------------------------------
   Header Space + Logo
   -------------------------------------------------------------------------- */
.header-spacer {
    height: 12px;
}

.section-logo {
    text-align: center;
    margin-bottom: 9px;
}

.hero-logo-image {
    max-width: 290px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.25));
}

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */

/* Show dividers on tablet+ */
@media (min-width: 640px) {
    .divider-tablet {
        display: block;
        margin: 18px auto;
    }
}

@media (min-width: 768px) {
    .divider-tablet {
        margin: 20px auto;
    }
}

@media (min-width: 900px) {
    .divider-tablet {
        margin: 24px auto;
    }
}

/* --------------------------------------------------------------------------
   Explainer Section
   -------------------------------------------------------------------------- */
.section-explainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    margin-bottom: var(--space-sm);
}

.divider-line {
    width: 100%;
    max-width: 320px;
    border: none;
    border-top: 1px solid var(--color-divider);
    margin: 0 auto;
    display: none;
}

.explainer-tagline {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 400;
    color: black;
    text-align: center;
    line-height: 26px;
}

.explainer-frame-img {
    max-width: 253px;
    width: 100%;
    height: auto;
}

/* Section 1: Tablet (640px+) */
@media (min-width: 640px) {
    .header-spacer {
        height: 14px;
    }

    .section-logo {
        margin-bottom: 12px;
    }

    .hero-logo-image {
        max-width: 320px;
    }

    .section-explainer {
        gap: 12px;
        margin-bottom: var(--space-xl);
    }

    .divider-line {
        max-width: 360px;
        display: block;
    }

    .explainer-tagline {
        font-size: 22px;
        line-height: 28px;
    }

    .explainer-frame-img {
        max-width: 300px;
    }
}

/* Section 1: iPad Portrait (768px+) */
@media (min-width: 768px) {
    .header-spacer {
        height: 16px;
    }

    .section-logo {
        margin-bottom: 16px;
    }

    .hero-logo-image {
        max-width: 360px;
    }

    .section-explainer {
        gap: 14px;
        margin-bottom: var(--space-2xl);
    }

    .divider-line {
        max-width: 400px;
    }

    .explainer-tagline {
        font-size: 24px;
        line-height: 30px;
    }

    .explainer-frame-img {
        max-width: 340px;
    }
}

/* Section 1: Desktop (900px+) */
@media (min-width: 900px) {
    .header-spacer {
        height: 18px;
    }

    .section-logo {
        margin-bottom: 20px;
    }

    .hero-logo-image {
        max-width: 400px;
    }

    .section-explainer {
        gap: 16px;
    }

    .divider-line {
        max-width: 440px;
    }

    .explainer-tagline {
        font-size: 26px;
        line-height: 32px;
    }

    .explainer-frame-img {
        max-width: 380px;
    }
}

/* Section 1: Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .header-spacer {
        height: 20px;
    }

    .hero-logo-image {
        max-width: 580px;
    }

    .section-explainer {
        gap: 34px;
        margin-bottom: var(--space-3xl);
    }

    .divider-line {
        max-width: 1000px;
    }

    .explainer-tagline {
        font-size: 36px;
        line-height: 46px;
    }

    .explainer-frame-img {
        max-width: 724px;
    }
}

/* --------------------------------------------------------------------------
   Upload Section
   -------------------------------------------------------------------------- */
.upload-grid {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-sm);
}

.upload-box {
    flex: 0 0 80px;
    height: 80px;
    border: 2px solid var(--color-teal);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: visible;
    background: var(--color-sand);
    box-shadow: 0px 4px 4px rgba(61, 50, 41, 0.25);
    transition:
        transform var(--duration-normal) var(--ease-bounce);
}

.upload-box:hover {
    transform: translateY(-2px) scale(1.05);
}

.upload-box:active {
    transform: translateY(0) scale(0.97);
}

.upload-box.has-image {
    overflow: visible;
    border-radius: 16px;
}

/* Plus icon — hidden in Figma design */
.upload-plus-icon {
    display: none;
}

.upload-box.has-image .upload-plus-icon {
    display: none;
}

.upload-box input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
}

.upload-icon-img {
    width: 70%;
    height: 80%;
    object-fit: contain;
    opacity: 1;
    border-radius: 0;
    box-shadow: none;
    transition: all var(--duration-normal) var(--ease-bounce);
}

/* Standing icon is landscape (wider than tall) — needs more width */
.upload-icon-img.upload-icon-wide {
    width: 94%;
    height: 69%;
}

.upload-box:hover .upload-icon-img {
    transform: scale(1.1);
}

.upload-box .preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: 14px;
    animation: imageReveal 0.4s var(--ease-bounce);
}

@keyframes imageReveal {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    60% {
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.upload-box.has-image .preview {
    display: block;
}

.upload-box.has-image .upload-content {
    display: none;
}

.upload-box.removing .preview {
    animation: imageRemove 0.2s var(--ease-smooth) forwards;
}

@keyframes imageRemove {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Success checkmark */
.upload-success {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-success);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    animation: successPop 0.5s var(--ease-bounce);
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.upload-box.upload-complete .upload-success {
    display: flex;
}

/* Loading spinner */
.upload-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-primary-bg);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    display: none;
    z-index: 10;
    animation: spin 0.8s linear infinite;
}

.upload-box.uploading .upload-loading {
    display: block;
}

.upload-box.uploading .upload-content {
    opacity: 0.3;
}

/* Remove photo button */
.remove-photo {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(61, 50, 41, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition:
        background var(--duration-fast) var(--ease-smooth),
        transform var(--duration-fast) var(--ease-bounce);
    backdrop-filter: blur(4px);
}

.remove-photo:hover {
    background: var(--color-danger);
    transform: scale(1.15);
}

.remove-photo:active {
    transform: scale(0.95);
}

.upload-box.has-image .remove-photo {
    display: flex;
    animation: fadeIn 0.2s var(--ease-smooth);
}

/* Section 2 (Upload): Larger phones (400px+) */
@media (min-width: 400px) {
    .upload-box {
        flex: 0 0 85px;
        height: 85px;
    }
}

/* Section 2 (Upload): Tablet (640px+) */
@media (min-width: 640px) {
    .section-card-upload {
        padding: var(--space-md) var(--space-lg) var(--space-xl);
    }

    .upload-grid {
        gap: var(--space-lg);
    }

    .upload-box {
        flex: 0 0 100px;
        height: 100px;
    }

}

/* Section 2 (Upload): iPad Portrait (768px+) */
@media (min-width: 768px) {
    .section-card-upload {
        padding: var(--space-lg) var(--space-xl) var(--space-xl);
    }

    .upload-grid {
        gap: var(--space-xl);
    }

    .upload-box {
        flex: 0 0 115px;
        height: 115px;
    }

    .upload-success {
        width: 32px;
        height: 32px;
    }

    .remove-photo {
        width: 32px;
        height: 32px;
        top: -12px;
        left: -12px;
    }
}

/* Section 2 (Upload): Desktop (900px+) */
@media (min-width: 900px) {
    .section-card-upload {
        padding: var(--space-lg) var(--space-xl) var(--space-2xl);
    }

    .upload-grid {
        gap: var(--space-2xl);
    }

    .upload-box {
        flex: 0 0 130px;
        height: 130px;
    }

    .upload-success {
        top: 8px;
        left: 8px;
    }

    .remove-photo {
        top: -12px;
        left: -12px;
    }
}

/* Section 2 (Upload): Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .section-card-upload {
        padding: var(--space-2xl) var(--space-3xl) var(--space-3xl);
    }

    .upload-grid {
        gap: 80px;
    }

    .upload-box {
        flex: 0 0 180px;
        height: 180px;
    }

    .upload-success {
        width: 42px;
        height: 42px;
        top: 10px;
        left: 10px;
    }

    .remove-photo {
        width: 42px;
        height: 42px;
        top: -16px;
        left: -16px;
    }
}

/* --------------------------------------------------------------------------
   Theme Section - Full Width on Mobile
   -------------------------------------------------------------------------- */
.section-theme {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    border-radius: 0;
}

/* Section 3 (Theme): Tablet (640px+) */
@media (min-width: 640px) {
    .section-theme {
        margin-left: 0;
        margin-right: 0;
    }

    .section-card-blue {
        padding: 14px 20px 20px;
    }
}

/* Section 3 (Theme): iPad Portrait (768px+) */
@media (min-width: 768px) {
    .section-card-blue {
        padding: 16px 24px 24px;
    }
}

/* Section 3 (Theme): Desktop (900px+) */
@media (min-width: 900px) {
    .section-card-blue {
        padding: 18px 28px 28px;
    }
}

/* Section 3 (Theme): Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .section-card-blue {
        padding: 32px 40px 32px;
        max-width: 1210px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* --------------------------------------------------------------------------
   Theme Selection
   -------------------------------------------------------------------------- */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 0;
    padding: 0 15px;
}

.theme-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: white;
    border: 1.5px solid var(--color-orange);
    border-radius: 15px;
    box-shadow: 0 3px 0 0 var(--color-orange-ledge), 0 4px 8px rgba(61, 50, 41, 0.12);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform var(--duration-normal) var(--ease-bounce),
                box-shadow var(--duration-normal) var(--ease-smooth);
    --sheen-angle: 115deg;
    --sheen-speed: 24s;
    --sheen-delay: 0s;
}

.theme-card:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 0 0 var(--color-orange-ledge), 0 6px 12px rgba(61, 50, 41, 0.16);
}

.theme-card:active {
    transform: scale(0.98) translateY(2px);
    box-shadow: 0 1px 0 0 var(--color-orange-ledge), 0 1px 3px rgba(61, 50, 41, 0.1);
}

.theme-card.selected {
    border-width: 3px;
    transform: scale(1.05);
}

/* Per-card light variation — subtle angle/speed differences for natural randomness */
.theme-card:nth-child(1) { --sheen-angle: 114deg; --sheen-speed: 16s; --sheen-delay: 0s; }
.theme-card:nth-child(2) { --sheen-angle: 116deg; --sheen-speed: 18s; --sheen-delay: -3s; }
.theme-card:nth-child(3) { --sheen-angle: 115deg; --sheen-speed: 15s; --sheen-delay: -6s; }
.theme-card:nth-child(4) { --sheen-angle: 113deg; --sheen-speed: 17s; --sheen-delay: -9s; }
.theme-card:nth-child(5) { --sheen-angle: 116deg; --sheen-speed: 16s; --sheen-delay: -12s; }
.theme-card:nth-child(6) { --sheen-angle: 114deg; --sheen-speed: 19s; --sheen-delay: -15s; }
.theme-card:nth-child(7) { --sheen-angle: 115deg; --sheen-speed: 16s; --sheen-delay: -1.5s; }
.theme-card:nth-child(8) { --sheen-angle: 117deg; --sheen-speed: 18s; --sheen-delay: -7s; }
.theme-card:nth-child(9) { --sheen-angle: 114deg; --sheen-speed: 15s; --sheen-delay: -10s; }

/* Specular highlight — sharp holographic sheen with contrast zones */
.theme-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    background: linear-gradient(
        var(--sheen-angle),
        transparent calc(var(--sheen-pos) - 48%),
        rgba(0, 0, 0, 0.03) calc(var(--sheen-pos) - 31%),
        rgba(120, 200, 255, 0.12) calc(var(--sheen-pos) - 14%),
        rgba(200, 235, 255, 0.2) calc(var(--sheen-pos) - 4%),
        rgba(255, 255, 255, 0.45) var(--sheen-pos),
        rgba(255, 220, 255, 0.2) calc(var(--sheen-pos) + 4%),
        rgba(255, 170, 255, 0.12) calc(var(--sheen-pos) + 14%),
        rgba(0, 0, 0, 0.03) calc(var(--sheen-pos) + 31%),
        transparent calc(var(--sheen-pos) + 48%)
    );
    animation: stickerSheen var(--sheen-speed) ease-in-out infinite;
    animation-delay: var(--sheen-delay);
    pointer-events: none;
    z-index: 3;
    mix-blend-mode: overlay;
}

/* Ambient glow — broad, soft diffuse light behind the specular highlight */
.theme-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    background: linear-gradient(
        var(--sheen-angle),
        transparent calc(var(--sheen-pos) - 63%),
        rgba(255, 255, 255, 0.07) var(--sheen-pos),
        transparent calc(var(--sheen-pos) + 63%)
    );
    animation: stickerSheen var(--sheen-speed) ease-in-out infinite;
    animation-delay: var(--sheen-delay);
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
}

.theme-card picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Sticker image — contact shadow for adhered-to-card look */
.theme-img {
    width: 95%;
    height: 95%;
    display: block;
    object-fit: cover;
    border-radius: 14px;
    transition: transform var(--duration-normal) var(--ease-bounce);
    filter:
        drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12))
        drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.08));
}

.theme-card:hover .theme-img {
    transform: scale(1.05);
}

.theme-card.selected .theme-img {
    transform: scale(1.03);
}

/* Per-card image adjustments */
.theme-card:nth-child(1) .theme-img,
.theme-card:nth-child(7) .theme-img {
    width: 90%;
    object-position: center 40%;
}

@keyframes stickerSheen {
    0%, 100% { --sheen-pos: -15%; }
    50% { --sheen-pos: 115%; }
}

/* Section 3 (Theme Grid): Tablet (640px+) */
@media (min-width: 640px) {
    .theme-grid {
        gap: 8px;
    }
}

/* Section 3 (Theme Grid): iPad Portrait (768px+) */
@media (min-width: 768px) {
    .theme-grid {
        gap: 12px;
    }
}

/* Section 3 (Theme Grid): Desktop (900px+) */
@media (min-width: 900px) {
    .theme-grid {
        gap: 16px;
    }
}

/* Section 3 (Theme Grid): Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .theme-grid {
        gap: 20px;
    }
}

/* --------------------------------------------------------------------------
   Action Area & Buttons
   -------------------------------------------------------------------------- */
.action-area {
    text-align: center;
}

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    padding: var(--space-md) var(--space-xl);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition:
        transform var(--duration-normal) var(--ease-bounce),
        box-shadow var(--duration-normal) var(--ease-smooth),
        background var(--duration-fast) var(--ease-smooth),
        border-color var(--duration-fast) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn:focus-visible,
.theme-card:focus-visible,
.library-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Make Stickers Button - Teal Pill, Full Width */
.btn-make-stickers {
    background: var(--color-teal);
    color: white;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 400;
    width: 305px;
    height: 54px;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    box-shadow: 0px 2px 6px rgba(61, 50, 41, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-make-stickers:hover:not(:disabled) {
    background: var(--color-teal-dark);
    transform: translateY(-1px);
    box-shadow: 0px 4px 12px rgba(61, 50, 41, 0.25);
}

.btn-make-stickers:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0px 1px 4px rgba(61, 50, 41, 0.2);
}

.btn-make-stickers:disabled {
    background: var(--color-teal);
    color: white;
    box-shadow: 0px 2px 6px rgba(61, 50, 41, 0.1);
    cursor: not-allowed;
    opacity: 0.45;
}

/* Button loading state */
.btn-make-stickers .btn-loader {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-make-stickers.loading .btn-text {
    visibility: hidden;
}

.btn-make-stickers.loading .btn-loader {
    display: block;
    position: absolute;
}

/* Secondary Button */
.btn-secondary {
    background: white;
    color: var(--color-text);
    border-color: var(--color-sand);
}

.btn-secondary:hover {
    border-color: var(--color-stone);
    background: var(--color-cream);
}

/* Ghost Danger Button */
.btn-ghost-danger {
    background: transparent;
    color: var(--color-danger);
    border-color: transparent;
}

.btn-ghost-danger:hover {
    background: rgba(217, 93, 93, 0.1);
}

/* Status Text */
.status-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    min-height: 0;
    margin: 0;
}

.status-text:not(:empty) {
    margin-top: var(--space-md);
    min-height: 1.4em;
}

.status-text.error {
    color: var(--color-danger);
}

/* Section 3 (Button): Tablet (640px+) */
@media (min-width: 640px) {
    .btn-make-stickers {
        font-size: 34px;
        width: auto;
        height: auto;
        padding: 12px 48px;
    }

    .status-text {
        font-size: 0.95rem;
    }
}

/* Section 3 (Button): iPad Portrait (768px+) */
@media (min-width: 768px) {
    .btn-make-stickers {
        font-size: 38px;
        width: auto;
        height: auto;
        padding: 14px 56px;
    }

    .status-text {
        font-size: 1rem;
        margin-top: var(--space-lg);
    }
}

/* Section 3 (Button): Desktop (900px+) */
@media (min-width: 900px) {
    .btn-make-stickers {
        font-size: 42px;
        width: auto;
        height: auto;
        padding: 16px 64px;
    }
}

/* Section 3 (Button): Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .btn-make-stickers {
        font-size: 46px;
        width: auto;
        height: auto;
        padding: 22px 72px;
    }

    .section-sign {
        max-width: 600px;
    }
}

/* --------------------------------------------------------------------------
   Library Section
   -------------------------------------------------------------------------- */
.section-library {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.section-library .section-header {
    margin-bottom: 0;
}


.make-to-ship-inline {
    display: block;
    max-width: 322px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.library-empty {
    text-align: center;
    width: 100%;
}

.library-empty-box {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 2 / 3;
    box-sizing: border-box;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    background: var(--color-cream);
    box-shadow: inset 0 2px 12px rgba(61, 50, 41, 0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

/* Ghost sticker illustrations */
.empty-ghost-sticker {
    position: absolute;
    opacity: 0.13;
    pointer-events: none;
    height: auto;
    animation: ghostFloat 4s var(--ease-smooth) infinite alternate;
}

.ghost-1 {
    width: 80px;
    top: 8%;
    left: 6%;
    transform: rotate(-12deg);
    animation-delay: 0s;
}

.ghost-2 {
    width: 90px;
    bottom: 22%;
    right: 4%;
    transform: rotate(8deg);
    animation-delay: -1.5s;
}

.ghost-3 {
    width: 85px;
    bottom: 5%;
    left: 10%;
    transform: rotate(-5deg);
    animation-delay: -3s;
}

@keyframes ghostFloat {
    from { translate: 0 0; }
    to { translate: 0 -8px; }
}

@keyframes ghostFloatLarge {
    from { translate: 0 0; }
    to { translate: 0 -14px; }
}

/* Text group centered above ghosts */
.empty-text-group {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.empty-text {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.empty-hint {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 400;
    color: var(--color-stone);
}

/* Library Preview */
.library-preview {
    margin-bottom: 0;
    animation: fadeIn 0.4s var(--ease-smooth);
}

.preview-frame {
    position: relative;
    background: var(--color-cream);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: inset 0 2px 8px rgba(61, 50, 41, 0.06);
}

.library-preview-image {
    width: 100%;
    max-width: 340px;
    max-height: 57vh;
    aspect-ratio: 2 / 3;
    margin: 0 auto;
    display: block;
    border-radius: 2px;
    background: white;
    /* Backing paper border */
    border: 6px solid white;
    /* Layered shadows: tight directional + soft ambient + top edge highlight */
    box-shadow:
        0 8px 20px rgba(61, 50, 41, 0.22),
        0 24px 60px rgba(61, 50, 41, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    /* 3D transform prep */
    will-change: transform;
    transform: perspective(400px) rotateX(0deg);
    transform-origin: center center;
    animation: sheetFloat 3.5s ease-in-out infinite;
}

.library-preview-image.preview-tilting {
    animation: none;
}

@keyframes sheetEntry {
    0% {
        transform: perspective(400px) rotateX(6deg) translateY(-30px) scale(0.93);
        box-shadow:
            0 2px 6px rgba(61, 50, 41, 0.1),
            0 8px 20px rgba(61, 50, 41, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        opacity: 0.6;
    }
    55% {
        transform: perspective(400px) rotateX(-3deg) translateY(6px) scale(1.01);
        box-shadow:
            0 20px 40px rgba(61, 50, 41, 0.30),
            0 40px 80px rgba(61, 50, 41, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        opacity: 1;
    }
    75% {
        transform: perspective(400px) rotateX(1.5deg) translateY(-3px) scale(0.99);
    }
    90% {
        transform: perspective(400px) rotateX(-0.5deg) translateY(1px) scale(1.0);
    }
    100% {
        transform: perspective(400px) rotateX(0deg) translateY(0) scale(1.0);
        box-shadow:
            0 8px 20px rgba(61, 50, 41, 0.22),
            0 24px 60px rgba(61, 50, 41, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        opacity: 1;
    }
}

.library-preview-image.preview-entering {
    animation: sheetEntry 0.6s var(--ease-smooth) forwards;
}

@keyframes sheetFloat {
    0%, 100% {
        transform: perspective(400px) rotateX(0deg) rotateY(0deg) translateY(0px) rotateZ(0deg);
        box-shadow:
            0 8px 20px rgba(61, 50, 41, 0.22),
            0 24px 60px rgba(61, 50, 41, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        transform: perspective(400px) rotateX(0deg) rotateY(0.8deg) translateY(-4px) rotateZ(0.2deg);
        box-shadow:
            0 12px 28px rgba(61, 50, 41, 0.18),
            0 32px 70px rgba(61, 50, 41, 0.10),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
}

.preview-specular {
    position: absolute;
    /* Match image position inside padded frame */
    top: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - var(--space-md) * 2), 340px);
    aspect-ratio: 2/3;
    border-radius: 2px;
    pointer-events: none;
    background: radial-gradient(
        ellipse 60% 40% at var(--specular-x, 30%) var(--specular-y, 25%),
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.06) 40%,
        transparent 70%
    );
    mix-blend-mode: overlay;
    z-index: 1;
}

.preview-cast-shadow {
    position: absolute;
    top: var(--space-md);
    left: 50%;
    transform: translateX(-50%) translateY(var(--shadow-drift, 0px));
    width: min(calc(100% - var(--space-md) * 2), 340px);
    aspect-ratio: 2/3;
    background: rgba(61, 50, 41, 0.09);
    filter: blur(6px);
    border-radius: 2px;
    pointer-events: none;
}

/* Library Connector - downward arrow between preview and carousel */
.library-connector {
    display: none;
}

.connector-arrow {
    width: 100%;
    height: 20px;
    stroke-width: 2.5;
}

@media (min-width: 768px) {
    .connector-arrow {
        height: 24px;
        stroke-width: 3;
    }
}

@media (min-width: 1200px) {
    .connector-arrow {
        height: 28px;
        stroke-width: 3.5;
    }
}

/* Library Grid - Horizontal Carousel */
.library-grid {
    display: flex;
    width: 100vw;
    gap: var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px calc(50vw - 80px) var(--space-md);
}

.library-grid::-webkit-scrollbar {
    display: none;
}

.library-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Fade edges to indicate scrollable content — applied via JS as mask-image */
.library-grid-wrapper {
    position: relative;
}

/* Library Card */
.library-card {
    flex: 0 0 130px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--color-cream-dark);
    cursor: pointer;
    transition:
        transform 0.15s ease-out,
        border-color var(--duration-fast) var(--ease-smooth),
        box-shadow var(--duration-normal) var(--ease-smooth);
    animation: fadeInUp 0.4s var(--ease-bounce);
    transform-origin: center center;
}

.library-card:hover {
    box-shadow: var(--shadow-lg);
}

.library-card.selected {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(232, 120, 90, 0.2);
}

.library-card-image {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}


.library-card-body {
    padding: var(--space-sm);
}


/* Has-quantity glow state (teal/green for "in cart") */
.library-card.has-quantity {
    border-width: 1.5px;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(19, 186, 160, 0.2), var(--shadow-md);
}

/* When both selected and has-quantity, show both indicators */
.library-card.has-quantity.selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(232, 120, 90, 0.2), 0 0 0 6px rgba(19, 186, 160, 0.12), var(--shadow-md);
}

/* Add Sheet Button */
.btn-add-sheet {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-teal);
    color: white;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-bounce);
    box-shadow: var(--shadow-sm);
}

@media (hover: hover) {
    .btn-add-sheet:hover {
        background: var(--color-teal-dark);
        transform: scale(1.03);
        box-shadow: var(--shadow-md);
    }
}

.btn-add-sheet:active {
    transform: scale(0.97);
}

/* Quantity Stepper */
.quantity-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: var(--space-xs);
    background: var(--color-cream);
    border-radius: var(--radius-full);
    padding: 4px;
}

.stepper-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    color: var(--color-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--duration-fast) var(--ease-bounce);
    box-shadow: var(--shadow-sm);
}

.stepper-icon {
    width: 44%;
    height: 44%;
}

@media (hover: hover) {
    .stepper-btn:hover:not(:disabled):not(.disabled) {
        background: var(--color-teal);
        color: white;
        transform: scale(1.1);
    }
}

.stepper-btn:active:not(:disabled):not(.disabled) {
    transform: scale(0.95);
}

.stepper-btn:disabled,
.stepper-btn.disabled {
    background: var(--color-cream-dark);
    color: var(--color-stone);
    cursor: not-allowed;
    box-shadow: none;
}

.stepper-value {
    min-width: 24px;
    text-align: center;
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-text);
    flex: 1;
}

/* Card body state transitions */
.library-card-body .btn-add-sheet {
    transition: all var(--duration-fast) var(--ease-bounce);
}

.library-card-body .quantity-stepper {
    transition: all var(--duration-fast) var(--ease-bounce);
}

.library-card-body .btn-add-sheet.hidden {
    display: none;
}

.library-card-body .quantity-stepper.hidden {
    display: none;
}

/* Section 4 (Library): Tablet (640px+) */
@media (min-width: 640px) {
    .section-library {
        gap: 10px;
    }

    .make-to-ship-inline {
        max-width: 360px;
    }

    .library-empty-box {
        max-width: 400px;
    }

    .ghost-1 { width: 90px; }
    .ghost-2 { width: 100px; }
    .ghost-3 { width: 95px; }

    .empty-text {
        font-size: 18px;
    }

    .empty-hint {
        font-size: 14px;
    }

    .preview-frame {
        padding: var(--space-lg);
    }

    .preview-specular {
        width: min(calc(100% - var(--space-lg) * 2), 400px);
        top: var(--space-lg);
    }

    .preview-cast-shadow {
        width: min(calc(100% - var(--space-lg) * 2), 400px);
        top: var(--space-lg);
    }

    .library-grid {
        gap: var(--space-lg);
    }

    .library-card-body {
        padding: var(--space-sm) var(--space-sm);
    }

    .btn-add-sheet {
        height: 38px;
        font-size: 14px;
    }

    .stepper-btn {
        width: 34px;
        height: 34px;
    }

}

/* Section 4 (Library): iPad Portrait (768px+) */
@media (min-width: 768px) {
    .section-library {
        gap: 14px;
    }

    .make-to-ship-inline {
        max-width: 400px;
    }

    .library-empty-box {
        max-width: 440px;
    }

    .ghost-1 { width: 100px; }
    .ghost-2 { width: 110px; }
    .ghost-3 { width: 105px; }

    .empty-text {
        font-size: 19px;
    }

    .empty-hint {
        font-size: 15px;
    }

    .library-preview {
        margin-bottom: var(--space-xl);
    }

    .preview-frame {
        padding: var(--space-xl);
        border-radius: var(--radius-xl);
    }

    .preview-specular {
        width: min(calc(100% - var(--space-xl) * 2), 440px);
        top: var(--space-xl);
    }

    .preview-cast-shadow {
        width: min(calc(100% - var(--space-xl) * 2), 440px);
        top: var(--space-xl);
    }

    .library-grid {
        gap: var(--space-xl);
        padding: var(--space-md) calc(50vw - 120px) var(--space-lg);
    }

    .library-card-body {
        padding: var(--space-md);
    }

    .btn-add-sheet {
        height: 40px;
        font-size: 14px;
    }

    .quantity-stepper {
        padding: 5px;
        gap: var(--space-sm);
    }

    .stepper-btn {
        width: 36px;
        height: 36px;
    }

    .stepper-value {
        font-size: 1.15rem;
        min-width: 28px;
    }

}

/* Section 4 (Library): Desktop (900px+) */
@media (min-width: 900px) {
    .section-library {
        gap: 18px;
    }

    .make-to-ship-inline {
        max-width: 440px;
    }

    .library-empty-box {
        max-width: 520px;
    }

    .ghost-1 { width: 125px; }
    .ghost-2 { width: 140px; }
    .ghost-3 { width: 130px; }

    .empty-text {
        font-size: 20px;
    }

    .empty-hint {
        font-size: 16px;
    }

    .library-preview {
        margin-bottom: var(--space-2xl);
    }

    .preview-frame {
        padding: var(--space-2xl);
    }

    .preview-specular {
        width: min(calc(100% - var(--space-2xl) * 2), 480px);
        top: var(--space-2xl);
    }

    .preview-cast-shadow {
        width: min(calc(100% - var(--space-2xl) * 2), 480px);
        top: var(--space-2xl);
    }

    .library-grid {
        gap: var(--space-2xl);
    }

    .library-card-body {
        padding: var(--space-md) var(--space-md);
    }

    .btn-add-sheet {
        height: 42px;
        font-size: 15px;
    }

    .quantity-stepper {
        padding: 6px;
    }

    .stepper-btn {
        width: 38px;
        height: 38px;
    }

    .stepper-value {
        font-size: 1.2rem;
        min-width: 32px;
    }

}

/* Section 4 (Library): Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .section-library {
        gap: 24px;
    }

    .make-to-ship-inline {
        max-width: 832px;
    }

    .library-empty-box {
        max-width: 560px;
    }

    .ghost-1 { width: 180px; }
    .ghost-2 { width: 210px; }
    .ghost-3 { width: 190px; }

    .empty-ghost-sticker { animation-name: ghostFloatLarge; }

    .empty-text {
        font-size: 28px;
    }

    .empty-hint {
        font-size: 20px;
    }

    .preview-frame {
        padding: var(--space-3xl);
    }

    .preview-specular {
        width: min(calc(100% - var(--space-3xl) * 2), 800px);
        top: var(--space-3xl);
    }

    .preview-cast-shadow {
        width: min(calc(100% - var(--space-3xl) * 2), 800px);
        top: var(--space-3xl);
    }

    .library-grid {
        gap: var(--space-3xl);
        padding: var(--space-xl) calc(50vw - 200px) var(--space-2xl);
    }

    .library-card {
        flex: 0 0 240px;
    }

    .library-card-body {
        padding: var(--space-lg);
    }

    .btn-add-sheet {
        height: 52px;
        font-size: 18px;
    }

    .quantity-stepper {
        padding: 8px;
        gap: var(--space-md);
    }

    .stepper-btn {
        width: 44px;
        height: 44px;
    }

    .stepper-value {
        font-size: 1.4rem;
        min-width: 40px;
    }

}

/* --------------------------------------------------------------------------
   Pricing Progress Bar
   -------------------------------------------------------------------------- */
.pricing-bar {
    max-width: 400px;
    margin: 0 auto 10px;
}

.pricing-bar-segments {
    display: flex;
    gap: 3px;
}

.pricing-segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.pricing-segment .segment-fill {
    width: 100%;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-sand);
    transition: background var(--duration-normal) var(--ease-smooth),
                box-shadow var(--duration-normal) var(--ease-smooth);
}

.pricing-segment:first-child .segment-fill {
    border-radius: var(--radius-full) 4px 4px var(--radius-full);
}

.pricing-segment:last-child .segment-fill {
    border-radius: 4px var(--radius-full) var(--radius-full) 4px;
}

.pricing-segment:not(:first-child):not(:last-child) .segment-fill {
    border-radius: 4px;
}

.pricing-segment.filled .segment-fill {
    background: var(--color-orange);
}

.pricing-segment.next .segment-fill {
    background: var(--color-orange);
    animation: segmentPulse 2s ease-in-out infinite;
}

@keyframes segmentPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.7; }
}

.segment-label {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-top: 5px;
    transition: color var(--duration-normal) var(--ease-smooth);
}

.pricing-segment.filled .segment-label,
.pricing-segment.next .segment-label {
    color: var(--color-text);
}

.segment-price {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 400;
    color: var(--color-text-muted);
    line-height: 1.1;
    transition: color var(--duration-normal) var(--ease-smooth),
                transform var(--duration-normal) var(--ease-bounce);
}

.pricing-segment.filled .segment-price {
    color: var(--color-orange);
    font-weight: 400;
}

.pricing-segment.active .segment-price {
    color: var(--color-orange-dark);
    font-size: 36px;
    font-weight: 400;
}

.pricing-segment.next .segment-price {
    color: var(--color-stone);
}

/* --------------------------------------------------------------------------
   Checkout Button - Large Orange Pill
   -------------------------------------------------------------------------- */
.checkout-button-container {
    text-align: center;
    margin: 8px 0 var(--space-md);
    padding: 0 var(--space-md);
}


.btn-checkout-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--color-sand);
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 400;
    padding: 14px 105px;
    border: 3px solid white;
    border-radius: 36px;
    cursor: pointer;
    box-shadow:
        5.4px 3.5px 10.3px rgba(61, 50, 41, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition:
        transform var(--duration-normal) var(--ease-bounce),
        box-shadow var(--duration-normal) var(--ease-smooth),
        background var(--duration-fast) var(--ease-smooth),
        color var(--duration-fast) var(--ease-smooth);
    text-transform: lowercase;
}

.checkout-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.btn-checkout-large:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        7px 5px 14px rgba(61, 50, 41, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-checkout-large:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-checkout-large:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-checkout-large:not(:disabled) {
    background: linear-gradient(180deg, var(--color-orange-light) 0%, var(--color-orange) 100%);
    color: white;
}

/* Section 4 (Checkout Button): Tablet (640px+) */
@media (min-width: 640px) {
    .pricing-bar {
        max-width: 420px;
        margin-bottom: 12px;
    }

    .segment-fill {
        height: 10px;
    }

    .segment-label {
        font-size: 15px;
    }

    .segment-price {
        font-size: 24px;
    }

    .pricing-segment.active .segment-price {
        font-size: 32px;
    }

    .checkout-button-container {
        margin: var(--space-xl) 0;
    }

    .btn-checkout-large {
        font-size: 30px;
        padding: 14px 58px;
        gap: 12px;
        border-radius: 40px;
    }

    .checkout-icon {
        width: 24px;
        height: 24px;
    }
}

/* Section 4 (Checkout Button): iPad Portrait (768px+) */
@media (min-width: 768px) {
    .checkout-button-container {
        margin: var(--space-2xl) 0;
        padding: 0 var(--space-lg);
    }

    .btn-checkout-large {
        font-size: 34px;
        padding: 16px 64px;
        border-radius: 44px;
        border-width: 3.5px;
    }

    .checkout-icon {
        width: 27px;
        height: 27px;
    }
}

/* Section 4 (Checkout Button): Desktop (900px+) */
@media (min-width: 900px) {
    .pricing-bar {
        max-width: 460px;
        margin-bottom: 14px;
    }

    .pricing-bar-segments {
        gap: 4px;
    }

    .segment-fill {
        height: 10px;
    }

    .segment-label {
        font-size: 16px;
        margin-top: 6px;
    }

    .segment-price {
        font-size: 28px;
    }

    .pricing-segment.active .segment-price {
        font-size: 38px;
    }

    .btn-checkout-large {
        font-size: 38px;
        padding: 18px 72px;
        gap: 14px;
        border-radius: 48px;
    }

    .checkout-icon {
        width: 30px;
        height: 30px;
    }
}

/* Section 4 (Checkout Button): Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .pricing-bar {
        max-width: 540px;
        margin-bottom: 16px;
    }

    .pricing-bar-segments {
        gap: 5px;
    }

    .segment-fill {
        height: 12px;
    }

    .segment-label {
        font-size: 18px;
        margin-top: 7px;
    }

    .segment-price {
        font-size: 34px;
    }

    .pricing-segment.active .segment-price {
        font-size: 46px;
    }

    .checkout-button-container {
        margin: var(--space-3xl) 0;
    }

    .btn-checkout-large {
        font-size: 44px;
        padding: 20px 80px;
        gap: 16px;
        border-radius: 56px;
        border-width: 4px;
        max-width: 560px;
    }

    .checkout-icon {
        width: 32px;
        height: 32px;
    }
}

/* --------------------------------------------------------------------------
   Feature Cards
   -------------------------------------------------------------------------- */
.feature-cards {
    text-align: center;
    margin: var(--space-xl) var(--space-md) 0;
}

.feature-cards-img {
    max-width: 370px;
    width: 100%;
    height: auto;
}

/* Feature Cards: Tablet (640px+) */
@media (min-width: 640px) {
    .feature-cards {
        margin: var(--space-2xl) auto 0;
    }

    .feature-cards-img {
        max-width: 520px;
    }
}

/* Feature Cards: iPad Portrait (768px+) */
@media (min-width: 768px) {
    .feature-cards-img {
        max-width: 600px;
    }
}

/* Feature Cards: Desktop (900px+) */
@media (min-width: 900px) {
    .feature-cards {
        margin-top: var(--space-2xl);
    }

    .feature-cards-img {
        max-width: 700px;
    }
}

/* Feature Cards: Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .feature-cards {
        margin-top: var(--space-3xl);
    }

    .feature-cards-img {
        max-width: 950px;
    }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: white;
    text-align: center;
    padding: 11px 25px;
    padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px));
    font-family: var(--font-content);
    font-size: 10px;
    color: black;
    line-height: 1.8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.site-footer p {
    margin: 0;
}

.footer-copyright {
    font-size: 16px;
    margin-bottom: 2px;
}

.footer-rights {
    font-size: 10px;
}

.footer-links {
    font-size: 8px;
}

.footer-links a {
    color: black;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-divider {
    border: none;
    border-top: 1px solid var(--color-divider);
    max-width: 273px;
    width: 70%;
    margin: 0 auto var(--space-lg);
}

/* Footer + Section Titles: Tablet (640px+) */
@media (min-width: 640px) {
    .section-title-text {
        font-size: 48px;
    }

    .section-subtitle {
        font-size: 20px;
    }
}

/* Footer + Section Titles: iPad Portrait (768px+) */
@media (min-width: 768px) {
    .section-title-text {
        font-size: 50px;
    }

    .section-subtitle {
        font-size: 21px;
    }

    .site-footer {
        padding: 14px 30px;
    }
}

/* Footer + Section Titles: Desktop (900px+) */
@media (min-width: 900px) {
    .section-title-text {
        font-size: 54px;
    }

    .section-subtitle {
        font-size: 22px;
    }

    .library-preview-image {
        max-width: 420px;
    }

    .site-footer {
        padding: 16px 40px;
    }

    .footer-copyright {
        font-size: 17px;
    }

    .footer-rights {
        font-size: 11px;
    }

    .footer-links {
        font-size: 9px;
    }
}

/* Footer + Section Titles: Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .section-title-text {
        font-size: 60px;
    }

    .section-subtitle {
        font-size: 24px;
        line-height: 34px;
    }

    .library-preview-image {
        max-width: 500px;
    }

    .site-footer {
        padding: 20px 48px;
    }

    .footer-copyright {
        font-size: 18px;
    }

    .footer-rights {
        font-size: 12px;
    }

    .footer-links {
        font-size: 10px;
    }
}

/* --------------------------------------------------------------------------
   Modal Styles
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--space-lg);
    animation: fadeIn 0.2s var(--ease-smooth);
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(61, 50, 41, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s var(--ease-bounce);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.modal-message {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
}

.modal-actions .btn {
    flex: 1;
    padding: var(--space-md);
}

/* Checkout Progress Modal */
.modal-checkout {
    text-align: center;
    border: 1px solid var(--color-text);
    border-radius: 20px;
    padding: 20px 12px;
    max-width: 260px;
    box-shadow: none;
}

.modal-checkout .modal-title {
    font-family: var(--font-body);
    font-size: 22px;
    font-weight: 400;
    color: var(--color-text);
    text-shadow: -0.8px 0.4px 1.6px rgba(0, 0, 0, 0.25);
    text-align: center;
    margin-bottom: 18px;
}

.checkout-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: var(--space-lg);
}

.checkout-step {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 58px;
    padding: 0 8px;
    border: 1px solid var(--color-text-secondary);
    background: white;
    transition: background var(--duration-normal) var(--ease-smooth), border-color var(--duration-normal) var(--ease-smooth);
}

.checkout-step:first-child {
    border-radius: 8px 8px 0 0;
}

.checkout-step:last-child {
    border-radius: 0 0 8px 8px;
}

.checkout-step + .checkout-step {
    border-top: none;
}

.step-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}

.checkout-step .step-label {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text-secondary);
    transition: color var(--duration-normal) var(--ease-smooth);
}

/* Active step: gold background with pulse animation on icon */
.checkout-step.active {
    background: var(--color-gold);
}

.checkout-step.active .step-icon {
    opacity: 1;
    animation: stepIconBounce 1.2s ease-in-out infinite;
}

.checkout-step.active .step-label {
    color: var(--color-text);
    font-weight: 400;
}

/* Completed step: gold background, full opacity */
.checkout-step.completed {
    background: var(--color-gold);
}

.checkout-step.completed .step-icon {
    opacity: 1;
}

.checkout-step.completed .step-label {
    color: var(--color-text);
    font-weight: 400;
}

@keyframes stepIconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.checkout-error {
    background: rgba(217, 93, 93, 0.1);
    color: var(--color-danger);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
    text-align: center;
}

/* Primary Button for modals */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    width: 100%;
    max-width: 280px;
    padding: var(--space-md) var(--space-xl);
    box-shadow: var(--shadow-md), 0 4px 0 var(--color-primary-dark);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 6px 0 var(--color-primary-dark);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: var(--shadow-sm), 0 2px 0 var(--color-primary-dark);
}

.btn-primary:disabled {
    background: var(--color-sand);
    color: var(--color-text-secondary);
    box-shadow: none;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading state for body */
.loading .btn-make-stickers {
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Global Breakpoints (non-section-specific)
   -------------------------------------------------------------------------- */

/* Tablet (640px+) */
@media (min-width: 640px) {
    .section-sign {
        max-width: 340px;
    }

    .library-preview-image {
        max-width: 400px;
    }

    .library-card {
        flex: 0 0 150px;
    }
}

/* iPad Portrait (768px+) */
@media (min-width: 768px) {
    .section-sign {
        max-width: 380px;
    }

    .library-preview-image {
        max-width: 440px;
    }

    .library-card {
        flex: 0 0 160px;
    }
}

/* Desktop (900px+) */
@media (min-width: 900px) {
    body {
        padding-bottom: 120px;
    }

    .section-sign {
        max-width: 420px;
    }

    .library-preview-image {
        max-width: 480px;
        max-height: none;
    }

    .library-card {
        flex: 0 0 170px;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    body {
        padding-bottom: 160px;
    }

    .section-sign {
        max-width: 600px;
    }

    .library-preview-image {
        max-width: 800px;
    }

    .library-card {
        flex: 0 0 240px;
    }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Coastal Construction single-theme layout */
.coastal-theme-grid {
    display: flex;
    justify-content: center;
}
.coastal-theme-grid .theme-card {
    width: min(300px, 60vw);
    cursor: default;
    animation: none;
}
.coastal-theme-grid .theme-card::before,
.coastal-theme-grid .theme-card::after {
    animation: none;
}
.coastal-theme-grid .theme-card:hover {
    transform: scale(1.05);
}
.coastal-theme-grid .theme-img {
    object-fit: contain;
    width: 95%;
    object-position: center;
}
