/* ============================================
   Perdysy Prescription Wizard — Frontend CSS
   ============================================ */

/* ========================================
   THEME-ISOLATION RESETS
   Prevents Didi, Elementor, Elessi, and
   other themes from overriding wizard styles.
   ======================================== */

/* Box-sizing reset for all wizard elements */
.perdysy-rx-overlay,
.perdysy-rx-overlay *,
.perdysy-rx-overlay *::before,
.perdysy-rx-overlay *::after {
    box-sizing: border-box !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography baseline inside wizard */
.perdysy-rx-overlay {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    word-spacing: normal !important;
    -webkit-text-size-adjust: 100% !important;
}

/* Heading resets — prevent theme h1-h4 */
.perdysy-rx-overlay h1,
.perdysy-rx-overlay h2,
.perdysy-rx-overlay h3,
.perdysy-rx-overlay h4 {
    font-family: inherit !important;
    color: #222 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    border: none !important;
    line-height: 1.3 !important;
}

/* Paragraph reset */
.perdysy-rx-overlay p {
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
}

/* Link reset — prevent theme link color bleed */
.perdysy-rx-overlay a {
    color: #0073aa !important;
    text-decoration: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
.perdysy-rx-overlay a:hover {
    color: #005a87 !important;
    text-decoration: underline !important;
}

/* Form element normalization */
.perdysy-rx-overlay select,
.perdysy-rx-overlay input[type="text"],
.perdysy-rx-overlay input[type="number"],
.perdysy-rx-overlay input[type="file"],
.perdysy-rx-overlay textarea {
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}
.perdysy-rx-overlay select:focus,
.perdysy-rx-overlay input[type="text"]:focus,
.perdysy-rx-overlay input[type="number"]:focus,
.perdysy-rx-overlay textarea:focus {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 1px #0073aa !important;
    outline: none !important;
}

/* Restore select dropdown arrow */
.perdysy-rx-overlay select {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    padding-right: 28px !important;
}

/* Label reset */
.perdysy-rx-overlay label {
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #555 !important;
    display: block !important;
    margin-bottom: 4px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Button reset — prevent theme button overrides */
.perdysy-rx-overlay button,
.perdysy-rx-overlay .perdysy-rx-btn {
    font-family: inherit !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    box-shadow: none !important;
    outline: none !important;
    transition: all 0.2s !important;
}

/* Image reset — prevent theme max-width / margin / border */
.perdysy-rx-overlay img {
    max-width: 100% !important;
    height: auto !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

/* Table reset */
.perdysy-rx-overlay table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
.perdysy-rx-overlay th,
.perdysy-rx-overlay td {
    font-family: inherit !important;
    font-size: inherit !important;
    text-align: center !important;
    padding: 4px 8px !important;
    border: 1px solid #ddd !important;
}

/* Checkbox/radio reset */
.perdysy-rx-overlay input[type="checkbox"],
.perdysy-rx-overlay input[type="radio"] {
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
}

/* Elementor z-index fix — ensure wizard sits above Elementor popups, sticky nav, etc. */
.perdysy-rx-overlay {
    z-index: 999999 !important;
}

/* Lightbox also above everything */
.rx-lightbox-overlay {
    z-index: 9999999 !important;
}

/* Overlay */
.perdysy-rx-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
}

/* Wizard Container */
.perdysy-rx-wizard {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 820px;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    padding: 24px;
    margin-bottom: 80px;
    animation: perdysySlideUp 0.35s cubic-bezier(.4,0,.2,1);
}

@keyframes perdysySlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Step transition animations */
@keyframes perdysyStepEnter {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes perdysyStepEnterReverse {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
.perdysy-rx-step.step-enter {
    animation: perdysyStepEnter 0.3s ease-out;
}
.perdysy-rx-step.step-enter-reverse {
    animation: perdysyStepEnterReverse 0.3s ease-out;
}

/* Close */
.perdysy-rx-close {
    position: absolute;
    top: 16px; right: 16px;
    background: #f0f1f3 !important;
    border: none !important;
    width: 36px; height: 36px;
    border-radius: 50% !important;
    font-size: 22px;
    cursor: pointer;
    color: #555 !important;
    line-height: 1;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.perdysy-rx-close:hover {
    background: #e74c3c !important;
    color: #fff !important;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(231,76,60,0.3);
}

/* Progress Steps */
.perdysy-rx-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 0;
}
.perdysy-rx-step-indicator {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #e8ecef;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
}
.perdysy-rx-step-indicator.active {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,115,170,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: scale(1.08);
}
.perdysy-rx-step-indicator.completed {
    background: linear-gradient(135deg, #46b450, #3a9e43);
    color: #fff;
    box-shadow: 0 4px 14px rgba(70,180,80,0.3);
}
.perdysy-rx-step-line {
    width: 60px; height: 4px;
    background: #e8ecef;
    border-radius: 2px;
    transition: background 0.4s;
}
.perdysy-rx-step-line.active {
    background: linear-gradient(90deg, #46b450, #0073aa);
}

/* Step Header */
.perdysy-rx-step-header {
    background: linear-gradient(135deg, #0077b6, #023e8a);
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0,115,170,0.20);
}
.perdysy-rx-step-header h2 {
    margin: 0 0 6px 0 !important;
    font-size: 20px;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.perdysy-rx-step-header .step-number {
    opacity: 0.7;
    font-weight: 400;
}
.perdysy-rx-step-header p {
    margin: 0 !important;
    font-size: 13px;
    opacity: 0.85;
    color: rgba(255,255,255,0.9) !important;
}

/* Help Button */
.perdysy-rx-help-btn {
    display: inline-flex;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    box-sizing: border-box;
}
.perdysy-rx-form .perdysy-rx-help-btn {
    background: #0073aa;
    color: #fff;
}

/* Lens Type Cards */
.perdysy-rx-lens-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.perdysy-rx-lens-card {
    border: 2px solid #e8ecef;
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    background: #fff;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.perdysy-rx-lens-card:hover {
    border-color: #0073aa;
    box-shadow: 0 8px 24px rgba(0,115,170,0.16);
    transform: translateY(-4px);
}
.perdysy-rx-lens-card.selected {
    border-color: #0073aa;
    background: linear-gradient(to bottom, #f0f8ff, #e6f2fb);
    box-shadow: 0 0 0 2px #0073aa, 0 8px 24px rgba(0,115,170,0.20);
}
.perdysy-rx-lens-card.selected::after {
    content: '✓ SELECTED';
    display: block;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 0;
    margin-top: auto;
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -18px;
    border-radius: 0 0 10px 10px;
    letter-spacing: 0.6px;
    width: calc(100% + 24px);
}
.perdysy-rx-lens-card img {
    max-width: 64px;
    max-height: 50px;
    margin-bottom: 8px;
}
.perdysy-rx-lens-card .card-name {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: #1f2937;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.perdysy-rx-lens-card .card-desc {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}
.perdysy-rx-lens-card .card-price {
    font-size: 13px;
    color: #0073aa;
    font-weight: 700;
}


/* Rx Form Table */
.perdysy-rx-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    overflow: hidden;
}
.perdysy-rx-table th {
    background: linear-gradient(180deg, #f8f9fa, #f0f1f3) !important;
    padding: 12px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #4a5568 !important;
    border: none !important;
    border-bottom: 2px solid #e5e7eb !important;
}
.perdysy-rx-table th:not(:last-child) {
    border-right: 1px solid #e5e7eb !important;
}
.perdysy-rx-table td {
    padding: 10px 8px !important;
    text-align: center !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
}
.perdysy-rx-table td:not(:last-child) {
    border-right: 1px solid #f0f0f0 !important;
}
.perdysy-rx-table tr:last-child td {
    border-bottom: none !important;
}
.perdysy-rx-table select {
    width: 100%;
    max-width: 120px;
    padding: 9px 10px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 13px;
    background-color: #fafbfc !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px !important;
    padding-right: 28px !important;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s !important;
}
.perdysy-rx-table select:focus {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.15) !important;
    background-color: #fff !important;
}
.perdysy-rx-eye-label {
    font-weight: 700;
    background: #f8fafc !important;
    text-align: left !important;
    padding-left: 16px !important;
    color: #374151 !important;
    font-size: 13px !important;
    white-space: nowrap;
}

/* Prism Section */
.perdysy-rx-prism-section,
.perdysy-rx-pd-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}
.perdysy-rx-prism-section h3,
.perdysy-rx-pd-section h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.perdysy-rx-prism-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
.perdysy-rx-prism-table thead th {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    padding: 8px 10px;
    text-align: center;
    border-bottom: 2px solid #ddd;
}
.perdysy-rx-prism-table thead th:first-child {
    width: 80px;
    text-align: left;
}
.perdysy-rx-prism-table tbody td {
    padding: 8px 10px;
    vertical-align: middle;
}
.perdysy-rx-prism-table tbody td.perdysy-rx-eye-label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
}
.perdysy-rx-prism-table select {
    width: 100%;
    padding: 8px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 13px;
    background-color: #fafbfc !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px !important;
    padding-right: 28px !important;
}
.perdysy-rx-pd-inputs select {
    width: 100%;
    max-width: 220px;
    padding: 8px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    background-color: #fafbfc !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px !important;
    padding-right: 28px !important;
}
.perdysy-rx-pd-inputs label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* PD Toggle */
.perdysy-rx-pd-toggle {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}
.perdysy-rx-pd-toggle label {
    cursor: pointer;
    font-size: 13px;
}
#perdysy-rx-pd-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Upload Section */
.perdysy-rx-upload-section {
    margin-bottom: 20px;
}
.perdysy-rx-upload-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
}
.perdysy-rx-upload-area input[type="file"] {
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}
#perdysy-rx-image-preview img {
    max-width: 200px;
    margin-top: 10px;
    border-radius: 6px;
}

/* Thickness Cards */
.perdysy-rx-thickness-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.perdysy-rx-thickness-card {
    border: 2px solid #e8ecef;
    border-radius: 14px;
    padding: 22px 16px 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    background: #fff;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.perdysy-rx-thickness-card:hover {
    border-color: #0073aa;
    box-shadow: 0 10px 28px rgba(0,115,170,0.16);
    transform: translateY(-4px);
}
.perdysy-rx-thickness-card.selected {
    border-color: #0073aa;
    background: linear-gradient(to bottom, #f0f8ff, #e6f2fb);
    box-shadow: 0 0 0 2px #0073aa, 0 8px 24px rgba(0,115,170,0.20);
}
.perdysy-rx-thickness-card.selected::after {
    content: '✓ SELECTED';
    display: block;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 0;
    margin: 14px -16px -20px -16px;
    border-radius: 0 0 12px 12px;
    letter-spacing: 0.6px;
    width: calc(100% + 32px);
}
.perdysy-rx-thickness-card img {
    max-width: 80px;
    max-height: 60px;
    margin-bottom: 10px;
    object-fit: contain;
}
.perdysy-rx-thickness-card .card-name {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.3;
}
.perdysy-rx-thickness-card .card-desc {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.4;
}
.perdysy-rx-thickness-card .card-price {
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
    margin-top: auto;
}
/* Recommended Badge */
.perdysy-rx-thickness-card .card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #46b450, #3a9e43);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.6px;
    box-shadow: 0 2px 6px rgba(70,180,80,0.3);
    z-index: 1;
}

/* Coatings Cards */
.perdysy-rx-coatings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.perdysy-rx-coating-card {
    border: 2px solid #e8ecef;
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    background: #fff;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.perdysy-rx-coating-card:hover {
    border-color: #46b450;
    box-shadow: 0 10px 28px rgba(70,180,80,0.16);
    transform: translateY(-4px);
}
.perdysy-rx-coating-card.selected {
    border-color: #46b450;
    background: linear-gradient(to bottom, #f0fff0, #e4fbe4);
    box-shadow: 0 0 0 2px #46b450, 0 8px 24px rgba(70,180,80,0.20);
}
.perdysy-rx-coating-card.selected::after {
    content: '✓ SELECTED';
    display: block;
    background: linear-gradient(135deg, #46b450, #3a9e43);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 0;
    margin: 14px -18px -18px -18px;
    border-radius: 0 0 10px 10px;
    letter-spacing: 0.6px;
    width: calc(100% + 36px);
}
.perdysy-rx-coating-card img {
    max-width: 80px;
    max-height: 60px;
    margin-bottom: 8px;
}
.perdysy-rx-coating-card .card-name {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}
.perdysy-rx-coating-card .card-type {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}
.perdysy-rx-coating-card .card-price {
    font-size: 14px;
    font-weight: 700;
    color: #46b450;
    margin-top: auto;
}
.perdysy-rx-coating-card .card-desc-wrap {
    margin-bottom: 6px;
}
.perdysy-rx-coating-card .card-desc {
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}
.perdysy-rx-coating-card .card-desc.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.perdysy-rx-coating-card .card-desc-toggle {
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    margin-top: 4px;
}
.perdysy-rx-coating-card .card-desc-toggle:hover {
    text-decoration: underline;
}
/* Tint Lens Preview */
.perdysy-rx-tint-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}
.perdysy-rx-tint-preview-wrap.align-left { align-items: flex-start; }
.perdysy-rx-tint-preview-wrap.align-right { align-items: flex-end; }
.perdysy-rx-tint-preview {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}
.perdysy-rx-tint-preview .tint-color-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: transparent;
    transition: background-color 0.3s ease;
    z-index: 1;
}
.perdysy-rx-tint-preview img {
    position: relative;
    display: block;
    max-width: 100%;
    height: auto;
    z-index: 2;
}
.perdysy-rx-tint-label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 18px;
}

/* Tints */
.perdysy-rx-tints-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.perdysy-rx-tint-swatch {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.perdysy-rx-tint-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.perdysy-rx-tint-swatch.selected {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.3);
}
.perdysy-rx-tint-swatch .tint-tooltip {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.perdysy-rx-tint-swatch:hover .tint-tooltip {
    opacity: 1;
}

/* Navigation Buttons */
.perdysy-rx-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
/* When only Continue is visible (no Back), push right */
.perdysy-rx-step-nav .perdysy-rx-btn-next:first-child,
.perdysy-rx-step-nav .perdysy-rx-btn-submit:first-child {
    margin-left: auto;
}
.perdysy-rx-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.perdysy-rx-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.perdysy-rx-btn-next,
.perdysy-rx-btn-submit {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
}
.perdysy-rx-btn-next::after {
    content: ' →';
    font-size: 16px;
    margin-left: 4px;
}
.perdysy-rx-btn-next:hover:not(:disabled),
.perdysy-rx-btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87, #004060);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,90,135,0.3);
}
.perdysy-rx-btn-back {
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
}
.perdysy-rx-btn-back::before {
    content: '← ';
    font-size: 16px;
    margin-right: 4px;
}
.perdysy-rx-btn-back:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
}

/* Sticky Price Bar */
.perdysy-rx-price-bar {
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    padding: 14px 24px;
    border-radius: 0 0 14px 14px;
    margin: 0 -24px -24px -24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.06);
}
.perdysy-rx-price-details {
    display: flex;
    gap: 24px;
}
.perdysy-rx-price-details span {
    opacity: 0.7;
    font-size: 13px;
}
.perdysy-rx-price-details strong {
    color: #7dd3fc;
    font-size: 14px;
}
.perdysy-rx-price-total {
    font-size: 14px;
    opacity: 0.85;
}
.perdysy-rx-price-total strong {
    font-size: 22px;
    color: #4ade80;
    text-shadow: 0 0 12px rgba(74,222,128,0.3);
}

/* Help Popup */
.perdysy-rx-help-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.perdysy-rx-help-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.perdysy-rx-help-close {
    position: absolute;
    top: -12px; right: -12px;
    width: 30px; height: 30px;
    background: #0073aa;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: background 0.2s;
}
.perdysy-rx-help-close:hover {
    background: #005a87;
}
.perdysy-rx-help-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
    text-transform: uppercase;
    font-weight: 700;
}
.perdysy-rx-help-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}
#perdysy-rx-help-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 4px;
    display: block;
}

/* Help Button inside cards — top-right corner */
.perdysy-rx-help-btn-card {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0;
    background: transparent !important;
    color: #9ca3af !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    z-index: 2;
    box-shadow: none !important;
    transition: all 0.2s;
    overflow: hidden;
}
.perdysy-rx-help-btn-card:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0,115,170,0.3);
}



/* Rx Entry Mode Toggle (Manual / Upload) — Pill Segments */
.perdysy-rx-entry-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f0f1f3;
    border-radius: 12px;
    padding: 4px;
}
.perdysy-rx-radio-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: none !important;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280 !important;
}
.perdysy-rx-radio-card:hover {
    color: #374151 !important;
    background: rgba(255,255,255,0.5);
}
.perdysy-rx-radio-card.active {
    background: #fff !important;
    color: #0073aa !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: none !important;
}
.perdysy-rx-radio-card input[type="radio"] {
    display: none;
}
.perdysy-rx-radio-card .radio-icon {
    font-size: 20px;
}

/* Prism Toggle (Checkbox) */
.perdysy-rx-prism-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 0;
}
.perdysy-rx-prism-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0073aa;
    cursor: pointer;
}
.perdysy-rx-prism-price {
    color: #e74c3c;
    font-size: 13px;
    font-weight: 700;
    margin-left: 4px;
}
.perdysy-rx-prism-fields {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
    animation: perdysyFadeIn 0.2s ease-out;
}

@keyframes perdysyFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* AXIS Column — hidden by default, shown by JS when CYL != 0 */
.perdysy-rx-axis-col.hidden {
    display: none !important;
}

/* PD "Don't know" Checkbox */
.perdysy-rx-pd-unknown {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    padding: 8px 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
}
.perdysy-rx-pd-unknown input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f59e0b;
}

/* Upload section info text */
.perdysy-rx-upload-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}
.rx-upload-status {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    color: #888;
}
.rx-upload-status.rx-upload-success {
    color: #46b450;
}
.rx-upload-status.rx-upload-error {
    color: #e74c3c;
}

/* Validation: Red error borders */
.perdysy-rx-red-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 1px #e74c3c !important;
}
.perdysy-rx-error-msg {
    color: #e74c3c;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    animation: perdysyFadeIn 0.2s ease-out;
}

/* ========================================
   CART PRESCRIPTION SUMMARY
======================================== */
.perdysy-rx-cart-summary {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}
.perdysy-rx-cart-summary .rx-cart-row {
    margin-bottom: 4px;
}
.perdysy-rx-cart-summary .rx-cart-addons {
    color: #666;
    font-style: italic;
}
.rx-cart-table {
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 12px;
    width: auto;
    min-width: 200px;
}
.rx-cart-table th,
.rx-cart-table td {
    border: 1px solid #ddd;
    padding: 3px 8px;
    text-align: center;
    white-space: nowrap;
}
.rx-cart-table thead th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
}
.rx-cart-table .rx-eye-label {
    font-weight: 700;
    background: #f9f9f9;
    text-align: left;
}
a.rx-view-prescription {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
a.rx-view-prescription:hover {
    text-decoration: underline;
    color: #005a87;
}

/* Prescription Image Lightbox */
.rx-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: perdysyFadeIn 0.2s ease-out;
}
.rx-lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.rx-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    border: none;
    transition: background 0.2s;
}
.rx-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Responsive — Tablet */
@media (max-width: 840px) {
    .perdysy-rx-lens-types { grid-template-columns: repeat(3, 1fr); }
    .perdysy-rx-thickness-list { grid-template-columns: repeat(2, 1fr); }
    .perdysy-rx-coatings-list { grid-template-columns: repeat(2, 1fr); }
}

/* Responsive — Phone */
@media (max-width: 640px) {
    .perdysy-rx-wizard { padding: 16px 14px; }
    .perdysy-rx-overlay { padding: 12px 8px; }
    .perdysy-rx-lens-types { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .perdysy-rx-thickness-list { grid-template-columns: 1fr; }
    .perdysy-rx-coatings-list { grid-template-columns: 1fr; }
    .perdysy-rx-prism-table select { font-size: 12px; padding: 6px; }
    .perdysy-rx-step-header { padding: 12px 14px; border-radius: 8px; }
    .perdysy-rx-step-header h2 { font-size: 16px; }
    .perdysy-rx-entry-toggle { flex-direction: column; }
    .perdysy-rx-table { font-size: 12px; }
    .perdysy-rx-table select { padding: 7px 8px !important; font-size: 12px; }
    .perdysy-rx-btn { padding: 12px 20px; font-size: 14px; width: auto; }
    .perdysy-rx-btn-next,
    .perdysy-rx-btn-submit { min-width: 140px; }
    .perdysy-rx-price-bar {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        margin: 0 -14px -16px -14px;
        padding: 12px 14px;
    }
    .perdysy-rx-price-details { flex-direction: row; gap: 12px; flex-wrap: wrap; justify-content: center; }
    .perdysy-rx-price-total strong { font-size: 20px; }
    .perdysy-rx-pd-toggle { flex-direction: column; gap: 8px; }
    .perdysy-rx-pd-inputs select { max-width: 100%; }
}
