/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&display=swap');

/* Frontend Styles for Safety Eye Guard Prescription Manager */

/* Modal Overlay */
.segpm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    font-family: 'Gilroy', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Modal Container - Full Height */
.segpm-modal {
    background: #fff;
    max-width: 1000px;
    width: 95%;
    height: 98vh;
    max-height: none;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Ensure inner wrapper fills the modal */
.segpm-prescription-form {
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Form Header */
.segpm-form-header {
    padding: 25px 30px;
    background: #000000;
    color: #fff;
    border-radius: 8px 8px 0 0;
    border-bottom: 3px solid #333;
}

.segpm-form-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.segpm-product-name {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Form Body */
.segpm-form-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Form Groups */
.segpm-form-group {
    margin-bottom: 25px;
}

.segpm-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.segpm-form-group .required {
    color: #dc3232;
}

.segpm-form-group select,
.segpm-form-group input[type="text"],
.segpm-form-group input[type="number"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.segpm-form-group select:focus,
.segpm-form-group input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.segpm-form-group .description {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #666;
}

/* Prescription Section */
.segpm-prescription-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #000;
}

.segpm-prescription-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

/* Eye Section */
.segpm-eye-section {
    margin-bottom: 25px;
}

.segpm-eye-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 2px solid #000;
}

.segpm-eye-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.segpm-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
    color: #555;
}

.segpm-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.segpm-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

/* Coating Section */
.segpm-coating-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #000;
}

.segpm-coating-section h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.segpm-coatings-list {
    margin-top: 15px;
}

.segpm-coating-option {
    margin-bottom: 12px;
}

.segpm-coating-option label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.segpm-coating-option label:hover {
    border-color: #000;
    background: #f9f9f9;
}

.segpm-coating-option input[type="checkbox"] {
    margin: 0 12px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.segpm-coating-option input[type="checkbox"]:checked+.coating-name {
    color: #000;
    font-weight: 600;
}

.segpm-coating-option .coating-name {
    flex: 1;
    font-size: 14px;
}

.segpm-coating-option .coating-price {
    font-weight: 600;
    color: #000;
    font-size: 14px;
}

/* Form Footer */
.segpm-form-footer {
    padding: 20px 30px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.segpm-form-footer .button {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.segpm-form-footer .button-primary {
    background: #000;
    color: #fff;
    font-weight: 700;
    border: 2px solid #000;
}

.segpm-form-footer .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #333;
    border-color: #333;
}

.segpm-form-footer #segpm-cancel-btn {
    background: #fff;
    border: 1px solid #ddd;
    color: #555;
}

.segpm-form-footer #segpm-cancel-btn:hover {
    background: #f5f5f5;
}

/* Loader */
.segpm-form-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.segpm-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: segpm-spin 1s linear infinite;
}

@keyframes segpm-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.segpm-form-loader p {
    margin-top: 15px;
    color: #555;
    font-weight: 600;
}

/* Order Display */
.segpm-prescription-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.segpm-prescription-table th,
.segpm-prescription-table td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.segpm-prescription-table th {
    background: #f5f5f5;
    font-weight: 600;
    width: 35%;
}

/* === SIMPLE DESIGN STYLES === */

/* Simple Header - Clean & Centered */
.segpm-form-header-simple {
    padding: 25px 30px;
    background: #fff;
    color: #000;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid #000;
    flex-shrink: 0;
    position: relative;
}

.segpm-form-header-simple h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000;
}

.segpm-form-header-simple .segpm-product-name {
    margin: 10px 0 0 0;
    font-size: 13px;
    text-align: center;
    color: #666;
}

/* Close Button */
.segpm-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
    color: #000;
}

.segpm-modal-close:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #f5f5f5;
}

.segpm-modal-close svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    pointer-events: none;
}

.segpm-modal-close svg path {
    fill: currentColor;
}

/* Simple Body - Scrollable */
.segpm-form-body-simple {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Simple Footer - Sticky at Bottom */
.segpm-form-footer-simple {
    padding: 20px 30px;
    background: #fff;
    border-top: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.segpm-btn-prev,
.segpm-btn-next,
.segpm-btn-submit {
    padding: 15px 35px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
}

.segpm-btn-prev {
    background: #fff;
    border: 2px solid #000;
    color: #000;
    min-width: 140px;
}

.segpm-btn-prev:hover {
    background: #f0f0f0;
}

.segpm-btn-next,
.segpm-btn-submit {
    background: #000 !important;
    color: #fff !important;
    font-weight: 800;
    border: 2px solid #000;
    text-transform: uppercase;
    min-width: 140px;
}

.segpm-btn-next:hover,
.segpm-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    background: #222 !important;
}

.segpm-btn-cancel {
    display: none !important;
}

/* Total Price Center */
.segpm-total-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.segpm-total-center .total-label {
    font-size: 14px;
    color: #000;
    font-weight: 700;
    text-transform: uppercase;
}

.segpm-total-center .total-value {
    font-size: 24px;
    font-weight: 700;
    color: #000;
}

/* Price Summary Final */
.segpm-price-summary-final {
    background: #f9f9f9;
    padding: 25px;
    margin: 30px 0 0 0;
    border: 2px solid #000;
    border-radius: 8px;
}

.segpm-price-summary-final h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #000;
    text-align: center;
}

/* Success Message */
.segpm-success-message {
    padding: 15px 20px;
    background: #f9f9f9;
    border-left: 4px solid #000;
    margin: 20px 0;
    border-radius: 4px;
}

.segpm-success-message p {
    margin: 0;
    color: #000;
    font-weight: 600;
}

/* === MULTI-STEP WIZARD STYLES === */

/* Progress Bar */
.segpm-progress-bar {
    display: flex;
    justify-content: space-between;
    margin: 20px 0 0 0;
    padding: 0;
    flex-wrap: wrap;
}

.segpm-progress-bar .segpm-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 10px 5px;
}

.segpm-progress-bar .segpm-step .step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: #666;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.segpm-progress-bar .segpm-step .step-label {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
}

.segpm-progress-bar .segpm-step.active .step-number {
    background: #000;
    color: #fff;
}

.segpm-progress-bar .segpm-step.active .step-label {
    color: #000;
    font-weight: 600;
}

.segpm-progress-bar .segpm-step.completed .step-number {
    background: #000;
    color: #fff;
}

.segpm-progress-bar .segpm-step.completed .step-label {
    color: #000;
}

/* Step visibility */
.segpm-form-step {
    display: none;
}

.segpm-form-step.active {
    display: block;
}

.segpm-form-step h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #000;
    font-weight: 700;
    display: none;
}

.segpm-form-step .description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

/* Option Grid */
.segpm-options-grid {
    display: block;
    margin: 20px 0;
}

.segpm-option-card {
    display: block;
    position: relative;
    cursor: pointer;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
}

.segpm-option-card:last-child {
    border-bottom: none;
}

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

.segpm-option-card .option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 20px;
    background: #fff;
    border: none;
    border-radius: 0;
    text-align: left;
    transition: all 0.3s;
    min-height: auto;
}

.segpm-option-card:hover .option-content {
    background: #fff9f5;
}

.segpm-option-card input:checked+.option-content {
    background: #fff9f5;
    border: none;
}

.segpm-option-card .option-left {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.segpm-option-card .option-icon {
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.segpm-option-card input:checked+.option-content .option-icon {
    border-color: #000;
    color: #000;
}

.segpm-option-card .option-info {
    flex: 1;
}

.segpm-option-card .option-name {
    display: block;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.4;
    color: #000;
}

.segpm-option-card input:checked+.option-content .option-name {
    color: #000;
}

.segpm-option-card .option-description {
    display: block;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-top: 5px;
}

.segpm-option-card .option-price {
    display: block;
    color: #000;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 20px;
}

.segpm-option-card input:checked+.option-content .option-price {
    color: #000;
}

/* Prescription Methods */
.segpm-prescription-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 20px 0;
}

.segpm-method-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    min-height: 400px;
}

.segpm-method-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.segpm-method-section h5 {
    margin: 15px 0 10px 0;
    font-size: 14px;
    color: #555;
    font-weight: 600;
}

/* File Upload */
.segpm-file-upload {
    margin: 15px 0;
}

.segpm-file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: block;
    padding: 30px 20px;
    background: #fff;
    border: 2px dashed #000;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    background: #f9f9f9;
    border-color: #333;
}

.file-upload-label .upload-icon {
    display: block;
    font-size: 40px;
    margin-bottom: 10px;
}

.file-upload-label .upload-text {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-upload-label .upload-formats {
    display: block;
    font-size: 12px;
    color: #666;
}

.file-upload-preview {
    padding: 15px;
    background: #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-upload-preview .file-name {
    flex: 1;
    font-weight: 600;
    color: #000;
}

.file-upload-preview .remove-file {
    background: #000;
    color: #fff;
    border: none;

    height: 30px;
   
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

/* Price Summary */
.segpm-price-summary {
    background: #f9f9f9;
    padding: 25px 30px;
    margin: 20px 0 0 0;
    border-top: 2px solid #e0e0e0;
    border-radius: 8px;
}

.segpm-price-summary h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #000;
}

.price-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.price-line.total-line {
    border-top: 2px solid #000;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 16px;
}

.price-label {
    color: #333;
}

.price-value {
    color: #000;
    font-weight: 600;
}

/* Form Group Textarea */
.segpm-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.segpm-form-group textarea:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Select Lens Button */
.segpm-select-lens-btn {
    margin-left: 10px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .segpm-modal {
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
        margin: 0;
    }

    .segpm-form-header-simple {
        padding: 15px 20px;
    }

    .segpm-form-header-simple h2 {
        font-size: 20px;
        margin-right: 30px; /* Space for close button */
    }

    .segpm-modal-close {
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
    }
    
    .segpm-modal-close svg {
        width: 18px !important;
        height: 18px !important;
    }

    .segpm-form-body-simple {
        padding: 20px;
    }

    /* Option Cards - Stack icon/content vertically if space is tight, or just reduce padding */
    .segpm-option-card .option-content {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .segpm-option-card .option-price {
        margin-left: 0;
        margin-top: 10px;
        align-self: flex-end;
    }

    /* Eye Fields - Stack vertically */
    .segpm-eye-fields {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Footer - Column layout for buttons */
    .segpm-form-footer-simple {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .segpm-total-center {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 10px;
    }

    .segpm-btn-prev,
    .segpm-btn-next,
    .segpm-btn-submit {
        width: 100%;
        padding: 12px;
    }

    /* Hide step labels on small screens */
    .segpm-progress-bar .segpm-step .step-label {
        font-size: 9px;
    }
    
    .segpm-prescription-methods {
        grid-template-columns: 1fr;
    }

    /* Select Lens Button Responsive */
    .segpm-select-lens-btn {
        display: block;
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .segpm-form-header-simple h2 {
        font-size: 18px;
    }
    
    .segpm-progress-bar .segpm-step .step-label {
        display: none; /* Hide labels completely on very small screens */
    }
    
    .segpm-progress-bar .segpm-step .step-number {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
    }
}