/* Lens Wizard Woo Modal - v3.3.0 - Modern Mobile Redesign */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --lwwmf-bg-overlay: rgba(0, 0, 0, 0.8);
    --lwwmf-bg-modal: #ffffff;
    --lwwmf-bg-secondary: #f9fafb;
    --lwwmf-primary: #111827;
    --lwwmf-accent: #2563eb;
    --lwwmf-accent-hover: #1d4ed8;
    --lwwmf-success: #10b981;
    --lwwmf-text-main: #374151;
    --lwwmf-text-muted: #6b7280;
    --lwwmf-border: #e5e7eb;
    --lwwmf-font: 'Inter', system-ui, -apple-system, sans-serif;
}

html.lwwmf-locked,
body.lwwmf-locked,
body.lwwmf-open-body {
    overflow: hidden !important;
}

.lwwmf-modal {
    position: fixed;
    inset: 0;
    background: var(--lwwmf-bg-modal);
    z-index: 999999;
    display: none;
    font-family: var(--lwwmf-font);
    overflow: hidden;
}

.lwwmf-modal.is-open {
    display: block;
}

.lwwmf-wrap {
    width: 100vw;
    height: 100vh;
    background: var(--lwwmf-bg-modal);
    display: grid;
    grid-template-columns: 50% 50%;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Transitions */
.lwwmf-fade-out {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.lwwmf-fade-in {
    animation: slideInRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   TABLET & MOBILE VIEW (Bottom Sheet Layout)
   ======================================== */
@media (max-width: 1024px) {
    .lwwmf-wrap {
        grid-template-columns: 100% !important;
        grid-template-rows: auto 1fr auto;
        overflow-y: auto;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Left Panel - Bottom Sheet Behavior */
    .lwwmf-left {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 85vh !important;
        max-height: 85vh !important;
        background: #fff;
        z-index: 1000;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 24px !important;
        display: flex !important;
        flex-direction: column;
        overflow-y: auto;
    }

    .lwwmf-left.lwwmf-details-open {
        transform: translateY(0);
    }

    /* Overlay when sheet is open */
    .lwwmf-left.lwwmf-details-open::before {
        content: '';
        position: fixed;
        top: -100vh;
        left: 0;
        right: 0;
        height: 200vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        pointer-events: all;
    }

    .lwwmf-prod {
        max-width: 100%;
        flex-direction: column;
        gap: 20px;
        align-items: center;
        padding: 0;
        cursor: default;
    }

    .lwwmf-prod img {
        max-height: 200px !important;
        max-width: 100% !important;
        border-radius: 12px;
        width: auto !important;
    }

    .lwwmf-summary {
        width: 100%;
        text-align: center;
    }

    .lwwmf-summary h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 12px;
        color: var(--lwwmf-primary);
        display: block !important;
    }

    .lwwmf-row {
        display: flex !important;
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .lwwmf-total {
        font-size: 20px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 2px solid var(--lwwmf-primary);
        justify-content: space-between;
    }

    .lwwmf-selection-preview {
        display: block !important;
        margin-top: 20px;
    }

    /* Header */
    .lwwmf-header {
        position: sticky;
        top: 0;
        z-index: 20;
        padding: 16px 20px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        width: 100%;
    }

    .lwwmf-title {
        font-size: 16px;
        font-weight: 600;
    }

    .lwwmf-subtotal {
        display: none !important;
    }

    .lwwmf-right {
        flex: 1;
        height: auto;
        display: flex;
        flex-direction: column;
        width: 100% !important;
        overflow: visible !important;
    }

    .lwwmf-body {
        flex: 1;
        padding: 24px 20px 100px 20px;
        overflow: visible !important;
    }

    /* Hide standard footer actions on mobile */
    .lwwmf-actions {
        display: none !important;
    }

    /* Mobile Footer Trigger */
    .lwwmf-mobile-footer-trigger {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 16px 20px;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
        z-index: 50;
        border-top: 1px solid var(--lwwmf-border);
        display: block;
    }

    .lwwmf-mft-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .lwwmf-mft-total {
        display: flex;
        flex-direction: column;
    }

    .lwwmf-mft-total span {
        font-size: 12px;
        color: var(--lwwmf-text-muted);
        font-weight: 500;
    }

    .lwwmf-mft-price {
        font-size: 18px;
        color: var(--lwwmf-primary);
        font-weight: 700;
    }

    .lwwmf-mft-btn {
        background: var(--lwwmf-bg-secondary);
        color: var(--lwwmf-primary);
        border: 1px solid var(--lwwmf-border);
        padding: 10px 20px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.2s;
    }

    .lwwmf-mft-btn:hover {
        background: #e5e7eb;
    }

    .lwwmf-mft-icon {
        font-size: 12px;
        transition: transform 0.3s;
    }

    /* Sheet Controls */
    .lwwmf-sheet-close {
        width: 100%;
        background: transparent;
        border: none;
        color: var(--lwwmf-text-muted);
        padding: 16px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        margin-top: 8px;
    }

    /* Mobile Typography Overrides */
    .lwwmf-final-selection h3 {
        font-size: 18px !important;
    }

    #lwwmf-prescription-form h3 {
        font-size: 18px !important;
    }
}

/* ========================================
   DESKTOP BASE STYLES
   ======================================== */

/* Left Panel */
.lwwmf-left {
    background: #ffffff;
    border-right: 1px solid var(--lwwmf-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    overflow-y: auto;
}

.lwwmf-prod {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.lwwmf-prod img {
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: contain;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
    z-index: 2;
}

.lwwmf-prod img:hover {
    transform: scale(1.02);
}

.lwwmf-summary {
    width: 100%;
    background: transparent;
    padding: 0;
}

.lwwmf-summary h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--lwwmf-primary);
    margin-bottom: 20px;
}

.lwwmf-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--lwwmf-text-muted);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 12px;
}

.lwwmf-row:last-of-type:not(.lwwmf-total) {
    border-bottom: none;
}

.lwwmf-row strong {
    color: var(--lwwmf-primary);
    font-weight: 600;
}

.lwwmf-row-price,
.lwwmf-row-lens {
    font-weight: 600;
    color: var(--lwwmf-primary);
}

.lwwmf-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--lwwmf-primary);
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: 800;
    color: var(--lwwmf-primary);
}

.lwwmf-selection-preview {
    margin-top: 15px;
    font-size: 13px;
    color: var(--lwwmf-text-muted);
    line-height: 1.6;
}

/* Right Panel */
.lwwmf-right {
    display: flex;
    flex-direction: column;
    background: #f1f1f1;
    overflow: hidden;
    height: 100%;
}

/* Header */
.lwwmf-header {
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--lwwmf-border);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.lwwmf-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--lwwmf-primary);
    flex: 1;
}

.lwwmf-subtotal {
    display: none;
}

.lwwmf-actions-top {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lwwmf-reset {
    background: #f3f4f6;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--lwwmf-text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lwwmf-reset:hover {
    background: #e5e7eb;
    color: var(--lwwmf-primary);
}

.lwwmf-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--lwwmf-text-muted);
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s;
}

.lwwmf-close-btn:hover {
    background: #f3f4f6;
    color: var(--lwwmf-primary);
}

/* Body */
.lwwmf-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    -webkit-overflow-scrolling: touch;
}

.lwwmf-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Enhanced Option Cards */
.lwwmf-option-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px 24px;
    background: #f8f9fa;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}

.lwwmf-option-btn:hover {
    background: #fff;
    border-color: var(--lwwmf-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.lwwmf-option-btn::after {
    content: '→';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #bdc3c7;
    transition: all 0.2s;
}

.lwwmf-option-btn:hover::after {
    color: var(--lwwmf-accent);
    right: 20px;
}

.lwwmf-opt-icon {
    margin-right: 16px;
    color: var(--lwwmf-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.lwwmf-opt-icon:empty {
    display: none;
    margin-right: 0;
}

.lwwmf-opt-content {
    flex: 1;
    padding-right: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lwwmf-opt-label {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    display: block;
    line-height: 1.2;
}

.lwwmf-opt-desc {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.5;
    display: block;
    font-weight: 400;
}

.lwwmf-opt-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--lwwmf-accent);
    margin-left: 8px;
    white-space: nowrap;
}

/* Final Selection */
.lwwmf-final-selection {
    text-align: center;
    padding: 40px;
    background: var(--lwwmf-bg-secondary);
    border-radius: 12px;
    border: 2px dashed var(--lwwmf-border);
}

.lwwmf-final-selection h3 {
    font-size: 24px;
    color: var(--lwwmf-primary);
    margin-bottom: 12px;
}

/* Prescription Form */
#lwwmf-prescription-form {
    padding: 20px 0;
}

#lwwmf-prescription-form h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--lwwmf-primary);
}

.lwwmf-linksRx {
    margin-bottom: 20px;
}

.lwwmf-cardRx {
    background: #fff;
    border: 1px solid var(--lwwmf-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.lwwmf-rowRx {
    display: grid;
    grid-template-columns: 60px repeat(4, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.lwwmf-rowRx .lbl {
    font-size: 13px;
    font-weight: 600;
    color: var(--lwwmf-text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .lwwmf-rowRx {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .lwwmf-rowRx>div:first-child {
        grid-column: 1 / -1;
        text-align: left;
        font-weight: bold;
        color: var(--lwwmf-primary);
    }
}

.lwwmf-h-sep {
    height: 1px;
    background: var(--lwwmf-border);
    margin: 20px 0;
}

.lwwmf-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lwwmf-group {
    margin-bottom: 16px;
}

.lwwmf-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--lwwmf-primary);
    margin-bottom: 8px;
}

.lwwmf-select,
.lwwmf-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--lwwmf-border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
}

.lwwmf-select:focus,
.lwwmf-input:focus {
    border-color: var(--lwwmf-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.lwwmf-file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-top: 12px;
}

.lwwmf-file-icon {
    font-size: 24px;
}

.lwwmf-file-info {
    flex: 1;
}

.lwwmf-file-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--lwwmf-primary);
    margin-bottom: 8px;
}

.lwwmf-file-size {
    display: block;
    font-size: 12px;
    color: var(--lwwmf-text-muted);
}

.lwwmf-file-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 20px;
    border-radius: 4px;
    transition: all 0.2s;
}

.lwwmf-file-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Actions */
.lwwmf-actions {
    padding: 24px 40px;
    border-top: 1px solid var(--lwwmf-border);
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    background: #fff;
}

.lwwmf-btn {
    height: 48px;
    padding: 0 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lwwmf-btn.muted {
    background: #f3f4f6;
    color: var(--lwwmf-text-muted);
}

.lwwmf-btn.muted:hover {
    background: #e5e7eb;
    color: var(--lwwmf-primary);
}

.lwwmf-btn.primary {
    background: var(--lwwmf-accent);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.lwwmf-btn.primary:hover {
    background: var(--lwwmf-accent-hover);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.lwwmf-btn:active {
    transform: scale(0.98);
}

.lwwmf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Utility Classes */
@media (min-width: 1025px) {
    .lwwmf-mobile-only {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .lwwmf-desktop-only {
        display: none !important;
    }
}