/* ==========================================================
   SHADCN/UI DESIGN SYSTEM - CSS Variables
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Colors - Light Mode (shadcn/ui style) */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;
    --radius: 3px;
    
    /* Spacing & Sizing */
    --spacing-xs: 0.15rem;
    --spacing-sm: 0.45rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1.2rem;
    --spacing-xl: 1.5rem;
    
    /* Shadows (shadcn/ui style) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* ==========================================================
   RESET & BASE
   ========================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================
   LAYOUT
   ========================================================== */
#app-container {
    max-width: 1200px;
    margin: var(--spacing-md) auto;
    padding: 0 var(--spacing-md);
    position: relative;
}


.main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: stretch;
}

/* Visual Panel (Left Column) */
.visual-panel {
    flex: 0 0 calc(41.66% - var(--spacing-sm));
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-self: stretch;
}

.product-image-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.image-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

.frame-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 2);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: 300px;
}

.summary-inline-container {
    width: 100%;
    padding: var(--spacing-md);
    margin-top: var(--spacing-sm);
    border-top: 2px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.1);
    border-radius: calc(var(--radius));
    text-align: left;
}

.summary-inline-container h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: hsl(var(--foreground));
}

.summary-inline-container .summary-inline {
    font-size: 0.875rem;
    line-height: 1.6;
    color: hsl(var(--foreground));
    word-wrap: break-word;
}

.summary-inline-container .summary-inline strong {
    color: hsl(var(--primary));
    font-weight: 600;
    margin-right: 0.25rem;
}

.summary-inline-container .separator {
    color: hsl(var(--muted-foreground));
    margin: 0 var(--spacing-sm);
    font-weight: 300;
}

.product-image-container img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: calc(var(--radius) * 2);
    border: 1px solid hsl(var(--border));
    object-fit: contain;
    display: block !important;
}

.product-image-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    text-align: center;
    margin: 0;
    flex-shrink: 0;
}

/* Image Carousel */
.image-carousel {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: -18px;
    background: hsl(38 92% 50%); /* Naranja/Amber para retroceder */
}

.carousel-btn.prev:hover {
    background: hsl(38 92% 45%);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.next {
    right: -18px;
    background: hsl(142 71% 45%); /* Verde para avanzar */
}

.carousel-btn.next:hover {
    background: hsl(142 71% 40%);
    transform: translateY(-50%) scale(1.1);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--spacing-xs);
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: hsl(var(--muted));
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.carousel-dot.active {
    background: hsl(var(--primary));
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background: hsl(var(--primary) / 0.6);
}

/* Options Panel (Right Column) - Card Component */
.options-panel {
    flex: 1;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 2);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    min-height: auto;
    align-self: stretch;
}

/* ==========================================================
   HEADER SECTION
   ========================================================== */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-md);
}

.header-text {
    flex: 1;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.8rem;
    margin-bottom: var(--spacing-xs);
    color: hsl(var(--foreground));
}

.subtitle {
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: 0;
}

/* ==========================================================
   BUTTON COMPONENT (shadcn/ui style)
   ========================================================== */
button {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2rem;
    border-radius: calc(var(--radius));
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border: none;
    outline: none;
}

/* Botón Volver - Color naranja como el slider */
.btn-prev {
    background-color: hsl(38 92% 50%);
    color: white;
    padding: calc(var(--spacing-xs) + 0.3rem) calc(var(--spacing-sm) + 0.3rem);
    border: none;
    height: 2.25rem;
    font-weight: 500;
}

.btn-prev:hover:not(:disabled) {
    background-color: hsl(38 92% 45%);
}

.btn-prev:focus-visible {
    outline: 2px solid hsl(38 92% 50%);
    outline-offset: 2px;
}

.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Botón Continuar - Color verde como el slider */
.btn-next {
    background-color: hsl(142 71% 45%);
    color: white;
    padding: calc(var(--spacing-xs) + 0.3rem) calc(var(--spacing-sm) + 0.3rem);
    border: none;
    height: 2.25rem;
    font-weight: 500;
}

.btn-next:hover:not(:disabled) {
    background-color: hsl(142 71% 40%);
}

.btn-next:focus-visible {
    outline: 2px solid hsl(142 71% 45%);
    outline-offset: 2px;
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-confirm {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: calc(var(--spacing-xs) + 0.3rem) calc(var(--spacing-md) + 0.3rem);
    height: 2.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-confirm:hover:not(:disabled) {
    background-color: hsl(var(--primary) / 0.9);
}

.btn-confirm:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-reset {
    background: transparent;
    color: hsl(var(--muted-foreground));
    text-decoration: underline;
    padding: var(--spacing-xs);
    font-size: 0.875rem;
    height: auto;
}

.btn-reset:hover {
    color: hsl(var(--foreground));
}

/* ==========================================================
   CARD COMPONENT (shadcn/ui style)
   ========================================================== */
.section-group {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: calc(var(--radius) * 1.5);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    transition: all 0.2s;
    display: none !important;
}

.section-group.active {
    display: block !important;
}

.section-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid hsl(var(--primary) / 0.2);
    letter-spacing: -0.02em;
}

/* Option Cards - Card variant */
.option-card {
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius));
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: hsl(var(--card));
}

.option-card:hover {
    background-color: hsl(var(--accent));
    border-color: hsl(var(--border));
    box-shadow: var(--shadow-sm);
}

.option-card.selected {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.05);
    box-shadow: var(--shadow-sm);
}

.option-card h3 {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2rem;
    margin-bottom: 0.15rem;
    color: hsl(var(--foreground));
}

.option-card p {
    font-size: 0.825rem;
    line-height: 1.125rem;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

/* ==========================================================
   INPUT COMPONENT (shadcn/ui style)
   ========================================================== */
/* PRESCRIPTION TABLES & INPUTS */
.prescription-container {
    width: 100%;
    padding: var(--spacing-md);
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 1.5);
    margin-top: var(--spacing-md);
}

.prescription-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: var(--spacing-md);
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
}

.prescription-table thead th {
    background: hsl(var(--muted) / 0.5);
    font-weight: 600;
    font-size: 0.8125rem;
    color: hsl(var(--foreground));
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    border-bottom: 2px solid hsl(var(--border));
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prescription-table thead th:first-child {
    text-align: left;
}

.prescription-table tbody td {
    padding: var(--spacing-md);
    border-bottom: 1px solid hsl(var(--border) / 0.3);
    background: hsl(var(--card));
}

.prescription-table tbody td:first-child {
    font-weight: 600;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    background: hsl(var(--muted) / 0.2);
}

.prescription-table tbody tr:last-child td {
    border-bottom: none;
}

.prescription-table tbody tr:hover td {
    background: hsl(var(--muted) / 0.1);
}

.prescription-table input {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s ease;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    text-align: center;
    font-weight: 500;
}

.prescription-table input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    background: hsl(var(--card));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

.prescription-table input::placeholder {
    color: hsl(var(--muted-foreground));
    font-weight: 400;
}

.prescription-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: var(--spacing-md) 0 var(--spacing-sm) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid hsl(var(--border));
}


/* ==========================================================
   SUBTOTAL BAR
   ========================================================== */
.subtotal-bar {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: hsl(var(--muted) / 0.5);
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) * 1.5);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

.price-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
}

.price-info:not(.total) {
    border-bottom: 1px solid hsl(var(--border) / 0.3);
}

.price-info.total {
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-sm);
    border-top: 2px solid hsl(var(--border));
}

.price-info span {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.price-info strong {
    font-size: 1rem;
    color: hsl(var(--foreground));
    font-weight: 600;
}

.price-info.total span {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.price-info.total strong {
    font-size: 1.375rem;
    color: hsl(var(--primary));
    font-weight: 700;
}

/* ==========================================================
   UTILITY CLASSES
   ========================================================== */
.info-text {
    font-size: 0.825rem;
    color: hsl(var(--muted-foreground));
    padding: var(--spacing-sm);
    text-align: center;
}

/* ==========================================================
   TOAST NOTIFICATIONS
   ========================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

.toast {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    position: relative;
}

.toast.success {
    border-left: 4px solid hsl(142 71% 45%);
}

.toast.error {
    border-left: 4px solid hsl(0 84.2% 60.2%);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.125rem;
}

.toast.success .toast-icon {
    background: hsl(142 71% 45% / 0.15);
    color: hsl(142 71% 45%);
}

.toast.error .toast-icon {
    background: hsl(0 84.2% 60.2% / 0.15);
    color: hsl(0 84.2% 60.2%);
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: hsl(var(--foreground));
    line-height: 1.4;
}

.toast-message {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.4;
}

.toast-close {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    background: transparent;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: var(--spacing-xs);
    line-height: 1;
    font-size: 1.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.toast-close:hover {
    opacity: 1;
    background: hsl(var(--muted) / 0.5);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==========================================================
   SUCCESS MODAL WITH CONFETTI
   ========================================================== */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.success-modal-content {
    background: hsl(var(--card));
    border-radius: var(--radius);
    padding: var(--spacing-xl) var(--spacing-lg);
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
    animation: modalSlideUp 0.5s ease-out;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: hsl(142 71% 45% / 0.15);
    color: hsl(142 71% 45%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 auto var(--spacing-md);
    animation: iconBounce 0.6s ease-out;
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

.success-message {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.success-submessage {
    font-size: 0.9375rem;
    color: hsl(var(--primary));
    font-weight: 600;
    margin-top: var(--spacing-md);
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: hsl(142 71% 45%);
    top: -10px;
    animation: confettiFall linear infinite;
    border-radius: 2px;
}

.confetti:nth-child(1) {
    left: 10%;
    background: hsl(142 71% 45%);
    animation-duration: 3s;
    animation-delay: 0s;
}

.confetti:nth-child(2) {
    left: 20%;
    background: hsl(38 92% 50%);
    animation-duration: 3.5s;
    animation-delay: 0.2s;
}

.confetti:nth-child(3) {
    left: 30%;
    background: hsl(221 83% 53%);
    animation-duration: 3.2s;
    animation-delay: 0.4s;
}

.confetti:nth-child(4) {
    left: 40%;
    background: hsl(142 71% 45%);
    animation-duration: 3.8s;
    animation-delay: 0.1s;
}

.confetti:nth-child(5) {
    left: 50%;
    background: hsl(0 84% 60%);
    animation-duration: 3.3s;
    animation-delay: 0.3s;
}

.confetti:nth-child(6) {
    left: 60%;
    background: hsl(221 83% 53%);
    animation-duration: 3.6s;
    animation-delay: 0.5s;
}

.confetti:nth-child(7) {
    left: 70%;
    background: hsl(142 71% 45%);
    animation-duration: 3.4s;
    animation-delay: 0.2s;
}

.confetti:nth-child(8) {
    left: 80%;
    background: hsl(38 92% 50%);
    animation-duration: 3.7s;
    animation-delay: 0.4s;
}

.confetti:nth-child(9) {
    left: 15%;
    background: hsl(221 83% 53%);
    animation-duration: 3.5s;
    animation-delay: 0.6s;
}

.confetti:nth-child(10) {
    left: 25%;
    background: hsl(142 71% 45%);
    animation-duration: 3.3s;
    animation-delay: 0.1s;
}

.confetti:nth-child(11) {
    left: 35%;
    background: hsl(0 84% 60%);
    animation-duration: 3.6s;
    animation-delay: 0.3s;
}

.confetti:nth-child(12) {
    left: 45%;
    background: hsl(38 92% 50%);
    animation-duration: 3.4s;
    animation-delay: 0.5s;
}

.confetti:nth-child(13) {
    left: 55%;
    background: hsl(221 83% 53%);
    animation-duration: 3.7s;
    animation-delay: 0.2s;
}

.confetti:nth-child(14) {
    left: 65%;
    background: hsl(142 71% 45%);
    animation-duration: 3.5s;
    animation-delay: 0.4s;
}

.confetti:nth-child(15) {
    left: 75%;
    background: hsl(38 92% 50%);
    animation-duration: 3.8s;
    animation-delay: 0.6s;
}

.confetti:nth-child(16) {
    left: 85%;
    background: hsl(0 84% 60%);
    animation-duration: 3.3s;
    animation-delay: 0.1s;
}

.confetti:nth-child(17) {
    left: 5%;
    background: hsl(221 83% 53%);
    animation-duration: 3.6s;
    animation-delay: 0.3s;
}

.confetti:nth-child(18) {
    left: 95%;
    background: hsl(142 71% 45%);
    animation-duration: 3.4s;
    animation-delay: 0.5s;
}

.confetti:nth-child(19) {
    left: 12%;
    background: hsl(38 92% 50%);
    animation-duration: 3.7s;
    animation-delay: 0.2s;
}

.confetti:nth-child(20) {
    left: 88%;
    background: hsl(221 83% 53%);
    animation-duration: 3.5s;
    animation-delay: 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 992px) {
    
    .main-layout {
        flex-direction: column; /* Layout vertical en tablet/móvil */
    }
    
    /* Cambiar el orden: opciones primero, visual después */
    .options-panel {
        order: 1;
        flex: 0 0 100%;
    }
    
    .visual-panel {
        order: 2;
        flex: 0 0 100%;
        margin-top: var(--spacing-md);
    }
    
    /* Panel visual más compacto en tablet */
    .visual-panel {
        margin-top: var(--spacing-md);
    }
    
    /* Layout horizontal en tablet */
    .frame-card {
        flex-direction: row;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .image-wrapper {
        flex: 0 0 40%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .image-wrapper img {
        max-height: 180px;
        width: auto;
        object-fit: contain;
    }
    
    .image-wrapper h3 {
        text-align: center;
    }
    
    .summary-inline-container {
        flex: 1;
        margin-top: 0;
        border-top: none;
        border-left: 2px solid hsl(var(--border));
    }
    
    
    .header-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-nav {
        margin-top: var(--spacing-sm);
        justify-content: flex-end;
    }
    
    /* Ajustar espaciado de tablas en tablet */
    .prescription-table input {
        font-size: 0.875rem;
        padding: calc(var(--spacing-sm) * 0.75);
    }
}

@media (max-width: 640px) {
    #app-container {
        margin: var(--spacing-sm) auto;
        padding: 0 var(--spacing-xs);
    }
    
    .options-panel {
        padding: var(--spacing-sm);
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    .subtitle {
        font-size: 0.8125rem;
    }
    
    /* Layout móvil: imagen izquierda, resumen derecha */
    .frame-card {
        flex-direction: row;
        align-items: stretch;
        padding: var(--spacing-sm);
        min-height: auto;
        gap: var(--spacing-sm);
    }
    
    /* Contenedor de imagen y nombre a la izquierda */
    .image-wrapper {
        flex: 0 0 35%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: var(--spacing-xs);
    }
    
    .image-wrapper img {
        max-height: 100px;
        max-width: 100%;
        width: auto;
        height: auto;
    }
    
    .image-wrapper h3 {
        font-size: 0.8125rem;
        text-align: center;
        width: 100%;
        word-break: break-word;
    }
    
    /* Resumen expandido a la derecha en móvil */
    .summary-inline-container {
        flex: 1;
        padding: var(--spacing-sm);
        margin-top: 0;
        border-left: 2px solid hsl(var(--border));
        border-top: none;
    }
    
    .summary-inline-container h2 {
        font-size: 0.875rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .summary-inline-container .summary-inline {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    .summary-inline-container .separator {
        margin: 0 var(--spacing-xs);
    }
    
    .summary-inline-container strong {
        font-size: 0.75rem;
    }
    
    /* Carrusel más compacto en móvil */
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
    }
    
    .carousel-btn.prev {
        left: -14px;
    }
    
    .carousel-btn.next {
        right: -14px;
    }
    
    .carousel-dot {
        width: 6px;
        height: 6px;
    }
    
    .carousel-dot.active {
        width: 18px;
    }
    
    /* Títulos de sección más pequeños */
    .section-title {
        font-size: 1.125rem;
        margin-bottom: var(--spacing-sm);
    }
    
    /* Option cards más compactas */
    .option-card {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
    }
    
    .option-card h3 {
        font-size: 0.9375rem;
    }
    
    .option-card p {
        font-size: 0.8125rem;
    }
    
    /* Tablas de dioptrías más compactas */
    .prescription-container {
        padding: var(--spacing-sm);
    }
    
    .prescription-table thead th {
        font-size: 0.6875rem;
        padding: calc(var(--spacing-xs) * 0.75) var(--spacing-xs);
    }
    
    .prescription-table tbody td {
        padding: var(--spacing-xs);
        font-size: 0.75rem;
    }
    
    .prescription-table tbody td:first-child {
        font-size: 0.75rem;
    }
    
    .prescription-table input {
        font-size: 0.8125rem;
        padding: calc(var(--spacing-xs) * 0.75);
        height: 2rem;
    }
    
    .prescription-section-title {
        font-size: 0.875rem;
    }
    
    /* Botones más compactos */
    .btn-next,
    .btn-prev,
    .btn-confirm {
        font-size: 0.8125rem;
        padding: calc(var(--spacing-xs) * 0.75) var(--spacing-sm);
        height: 2rem;
    }
    
    /* Subtotal más compacto */
    .subtotal-bar {
        padding: var(--spacing-sm);
        font-size: 0.8125rem;
    }
    
    .price-info span {
        font-size: 0.75rem;
    }
    
    .price-info strong {
        font-size: 0.9375rem;
    }
    
    .price-info.total span {
        font-size: 0.875rem;
    }
    
    .price-info.total strong {
        font-size: 1.125rem;
    }
    
    /* Toast notifications responsive */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .toast-title {
        font-size: 0.875rem;
    }
    
    .toast-message {
        font-size: 0.8125rem;
    }
    
    /* Success modal responsive */
    .success-modal-content {
        padding: var(--spacing-lg) var(--spacing-md);
        width: 95%;
        max-width: 100%;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2.25rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .success-title {
        font-size: 1.375rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .success-message {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
    
    .success-submessage {
        font-size: 0.875rem;
    }
}
