/* OPM Frontend Styles */
.opm-prescription-wrapper {
    background: #f8faff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    font-family: inherit;
    box-sizing: border-box;
}

.opm-prescription-wrapper * {
    box-sizing: border-box;
}

.opm-lens-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.opm-lens-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: block;
    margin: 0;
}

.opm-lens-card:hover {
    border-color: #4361ee;
    box-shadow: 0 4px 12px rgba(67,97,238,0.15);
}

.opm-lens-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.opm-lens-selected-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4361ee;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.opm-lens-card:has(input[type="radio"]:checked) {
    border-color: #4361ee;
    background: #eef2ff;
    box-shadow: 0 4px 16px rgba(67,97,238,0.2);
}

.opm-lens-card:has(input[type="radio"]:checked) .opm-lens-selected-icon {
    opacity: 1;
    transform: scale(1);
}

.opm-card-content h4 {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.opm-card-content p {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.opm-price-badge {
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.opm-badge-included {
    background: #e6f8f1;
    color: #10b981;
}

.opm-badge-add {
    background: #eef2ff;
    color: #4361ee;
}

.opm-section-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
}

.opm-section-divider::before,
.opm-section-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.opm-section-divider span {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
    padding: 0 16px;
    border-left: 3px solid #4361ee;
    margin-left: 10px;
}

.opm-section-divider::before {
    display: none;
}

.opm-use-saved-prescription {
    background: #eef2ff;
    border-radius: 8px;
    padding: 10px 14px;
    color: #4361ee;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.opm-use-saved-prescription input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.opm-prescription-table-wrap {
    width: 100%;
}

.opm-prescription-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin: 0;
    background: #fff;
}

.opm-prescription-table thead {
    background: #1a1a2e;
}

.opm-prescription-table th {
    color: #ffffff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    font-weight: 600;
    text-align: center;
}

.opm-eye-label {
    font-weight: 700;
    font-size: 13px;
    color: #4361ee !important;
    background: #f8faff;
    padding: 12px 16px !important;
    width: 100px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    text-align: left !important;
}

.opm-prescription-table td {
    padding: 8px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.opm-prescription-table td:last-child {
    border-right: none;
}

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

.opm-input {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
    outline: none;
    color: #1e293b;
    background: #fff;
    font-family: inherit;
}

.opm-input:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

.opm-input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* Custom Select Styling */
.opm-select-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.opm-select-wrapper::after {
    content: ""; /* SVG Down Arrow */
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 12px;
    height: 7px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.opm-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 32px 10px 12px;
    cursor: pointer;
}

/* Dim the arrow on disabled */
.opm-disabled::after {
    opacity: 0.3;
}


.opm-prescription-extras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.opm-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    display: block;
}

/* Add Power Fade In */
#opm_add_power_wrap {
    animation: opmFadeIn 0.3s ease forwards;
}

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

.opm-active-price-display {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 20px;
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opm-price-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.opm-price-value {
    font-weight: 700;
    font-size: 18px;
    color: #4361ee;
    transition: transform 0.2s ease;
}

.opm-pulse-anim {
    animation: opmPulse 0.3s ease;
}

@keyframes opmPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile Breakpoints */
@media (max-width: 768px) {
    .opm-lens-type-grid {
        grid-template-columns: 1fr;
    }
    
    .opm-prescription-extras {
        grid-template-columns: 1fr;
    }

    .opm-prescription-wrapper {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .opm-prescription-table thead {
        display: none;
    }

    .opm-prescription-table, 
    .opm-prescription-table tbody, 
    .opm-prescription-table tr {
        display: block;
        width: 100%;
        border: none;
    }

    .opm-eye-row {
        background: #ffffff;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 12px;
        position: relative;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .opm-prescription-table td {
        display: block;
        border: none;
        padding: 4px;
        flex: 1 1 calc(33.333% - 8px);
    }

    .opm-eye-label {
        flex: 1 1 100% !important;
        background: transparent !important;
        border: none !important;
        padding: 4px !important;
        margin-bottom: 8px;
        font-size: 14px;
    }

    .opm-prescription-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        color: #64748b;
        font-weight: 600;
        margin-bottom: 4px;
        text-transform: uppercase;
        text-align: center;
    }
    
    .opm-eye-label::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .opm-lens-card {
        padding: 12px;
    }

    .opm-section-divider span {
        font-size: 14px;
    }
}
