/**
 * Upload Configurator Styles
 * Matches TheUnframer theme design
 */

/* ===================================
   Main Layout
   =================================== */

.upload-configurator {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.configurator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .configurator-grid {
        grid-template-columns: 400px 1fr;
        gap: 3rem;
    }

    /* Initial state: full-width upload before photos are added */
    .configurator-grid.no-photos {
        grid-template-columns: 1fr;
        max-width: 800px;
        margin: 0 auto;
    }

    .configurator-grid.no-photos .configurator-sidebar {
        width: 100%;
    }

    .configurator-grid.no-photos .configurator-main {
        display: none;
    }

    .configurator-grid.no-photos #configuration-container {
        display: none;
    }

    .configurator-grid.no-photos .dropzone {
        padding: 3rem 2rem;
    }

    .configurator-grid.no-photos .dropzone-icon {
        width: 64px;
        height: 64px;
    }

    .configurator-grid.no-photos .dropzone-text {
        font-size: 1.1rem;
    }
}

.configurator-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.configurator-main {
    position: sticky;
    top: 180px;
    height: calc(100vh - 200px);
    min-height: 500px;
    max-height: 800px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===================================
   Photo Upload Component
   =================================== */

.photo-upload-wrapper {
    margin-bottom: 0.75rem;
}

.photo-upload-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #3d4348;
    margin-bottom: 0.5rem;
}

.dropzone {
    position: relative;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background-color: #f7fafc;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone:hover {
    border-color: #fbb44c;
    background-color: #fff;
}

.dropzone.dragover {
    border-color: #fbb44c;
    background-color: #fff8e6;
    transform: scale(1.01);
}

.dropzone-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    color: #a0aec0;
}

.dropzone-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0;
}

.dropzone-link {
    color: #fbb44c;
    font-weight: 600;
    text-decoration: none;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: #a0aec0;
    margin: 0;
}

.dropzone-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #4a5568;
}

.loading-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fbb44c;
    animation: pulse 1.5s ease-in-out infinite;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #fbb44c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.upload-progress-bar {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbb44c 0%, #f9a825 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.upload-progress-text {
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 500;
}

.dropzone-error,
.upload-error-message {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 4px;
    color: #c53030;
    font-size: 0.875rem;
    text-align: left;
}

.dropzone-error .error-text,
.upload-error-message .error-text {
    display: block;
    white-space: pre-line;
}

.dropzone-error .btn-back-to-upload,
.upload-error-message .btn-back-to-upload {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.4rem 0.9rem;
    background-color: #c53030;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.dropzone-error .btn-back-to-upload:hover,
.upload-error-message .btn-back-to-upload:hover {
    background-color: #9b2c2c;
}

.gallery-protected {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

.gallery-thumbs-preview {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.gallery-thumb-preview {
    width: 56px;
    height: 56px;
    padding: 0;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb-preview:hover {
    transform: translateY(-1px);
    border-color: #3d4348;
}

.gallery-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pdf-note {
    margin: 0 0 1rem 0;
    padding: 0.6rem 0.85rem;
    background-color: #fff8e1;
    border-left: 3px solid #fbb44c;
    color: #3d4348;
    font-size: 0.9rem;
    border-radius: 4px;
}

.pdf-size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pdf-size-input-group {
    display: flex;
    flex-direction: column;
}

.config-sublabel {
    font-size: 0.8rem;
    color: #4a5568;
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

/* ===================================
   Printed Item Notice
   =================================== */

.printed-item-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.printed-item-notice .notice-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: #718096;
}

.printed-item-notice .notice-links {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: #718096;
}

.printed-item-notice a {
    color: #4a5568;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.printed-item-notice a:hover {
    color: #fbb44c;
}

.printed-item-notice .btn-order-form {
    display: inline-block;
    padding: 0.45rem 0.95rem;
    margin: 0.25rem 0;
    background-color: #3d4348;
    color: #fff !important;
    border: 1px solid #3d4348;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
}

.printed-item-notice .btn-order-form:hover {
    background-color: #fbb44c;
    color: #3d4348 !important;
    border-color: #fbb44c;
}

/* ===================================
   Image Rights Agreement Checkbox
   =================================== */

.image-rights-agreement {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
}

.image-rights-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.image-rights-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #fbb44c;
}

.image-rights-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: #92400e;
    line-height: 1.5;
}

.required-asterisk {
    color: #dc2626;
    font-weight: 600;
}

.image-rights-subtext {
    margin: 0.5rem 0 0 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #78350f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Disabled dropzone state */
.dropzone.dropzone-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #cbd5e0;
    background-color: #f1f5f9;
}

.dropzone.dropzone-disabled:hover {
    border-color: #cbd5e0;
    background-color: #f1f5f9;
}

.dropzone.dropzone-disabled .dropzone-text {
    color: #94a3b8;
}

.dropzone.dropzone-disabled .dropzone-link {
    color: #94a3b8;
    pointer-events: none;
}

.image-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.image-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 1rem;
}

.btn-replace {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid #fbb44c;
    border-radius: 4px;
    color: #fbb44c;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-replace:hover {
    background-color: #fbb44c;
    color: #fff;
}

.btn-replace-icon {
    width: 16px;
    height: 16px;
}

/* ===================================
   Configuration Panel
   =================================== */

.configuration-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.configuration-panel.hidden {
    display: none;
}

.config-section {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.config-section:last-of-type {
    border-bottom: none;
}

.config-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #3d4348;
    margin-bottom: 0.5rem;
}

.config-select {
    width: 100%;
    height: auto;
    min-height: 50px;
    padding: 0.875rem 3rem 0.875rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #2d3748;
    background-color: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    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='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.config-select option {
    padding: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

.config-select:hover {
    border-color: #a0aec0;
}

.config-select:focus {
    outline: none;
    border-color: #fbb44c;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.1);
}

.config-description {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #718096;
    line-height: 1.4;
}

/* Custom Size Inputs */
.custom-size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.size-input-group {
    display: flex;
    flex-direction: column;
}

.size-input-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.5rem;
}

.size-input {
    padding: 0.65rem 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #2d3748;
    background-color: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.size-input:hover {
    border-color: #a0aec0;
}

.size-input:focus {
    outline: none;
    border-color: #fbb44c;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.1);
}

/* Mount Style Selector */
.style-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.style-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-option:hover {
    border-color: #cbd5e0;
    background-color: #fff;
}

.style-option.active {
    border-color: #fbb44c;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.1);
}

.style-option-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #2d3748;
    font-weight: 500;
    flex: 1;
}

.style-option .rotator-preview-btn {
    width: 36px;
    min-height: 36px;
    padding: 0;
    background-color: transparent;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-option .rotator-preview-btn:hover {
    background-color: #fbb44c;
    border-color: #fbb44c;
    color: #fff;
}

.style-option .rotator-preview-btn svg {
    width: 18px;
    height: 18px;
}

/* Finish Selector */
.finish-section {
    /* No animation - prevents visual jump on re-render */
}

.finish-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.finish-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.finish-option:hover {
    border-color: #fbb44c;
    background-color: #fff;
}

.finish-option.active {
    border-color: #fbb44c;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.1);
}

.finish-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    cursor: pointer;
    accent-color: #fbb44c;
    flex-shrink: 0;
}

.finish-color {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.finish-thumbnail-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.finish-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #2d3748;
    font-weight: 500;
    flex: 1;
}

.finish-preview-hint {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: #a0aec0;
    font-style: italic;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.finish-option:hover .finish-preview-hint {
    opacity: 1;
}

/* Print Option */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.config-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #fbb44c;
}

.checkbox-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #2d3748;
    cursor: pointer;
    margin: 0;
}

/* Order Type Radio Options */
.order-type-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-type-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #2d3748;
    margin: 0;
}

.order-type-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #fbb44c;
}

.config-hint {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #2d3748;
    line-height: 1.4;
    font-weight: 600;
}

.config-hint.pickup-other-hint {
    color: #b45309;
    background-color: #fef3c7;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
    margin-top: 0.75rem;
}

/* Price Display */
.price-section {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #fbb44c 0%, #f39c12 100%);
    border-radius: 8px;
    text-align: center;
}

.price-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 0.5rem;
}

.price-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.price-value.invalid {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

.price-message {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.price-message.error {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Manual Quote Notice */
.manual-quote-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.manual-quote-notice .notice-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.manual-quote-notice .notice-icon svg {
    width: 48px;
    height: 48px;
    color: #f59e0b;
}

.manual-quote-notice h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 0.5rem 0;
}

.manual-quote-notice p {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #78350f;
    margin: 0;
    line-height: 1.5;
}

/* Gallery Order Notice (for gallery images - manual order mode) */
.gallery-order-notice {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 2px solid #38bdf8;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.gallery-order-notice .notice-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.gallery-order-notice .notice-icon svg {
    width: 48px;
    height: 48px;
    color: #0284c7;
}

.gallery-order-notice h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #075985;
    margin: 0 0 0.5rem 0;
}

.gallery-order-notice p {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #0c4a6e;
    margin: 0;
    line-height: 1.5;
}

/* Manual Order Tag (for gallery items in order summary) */
.manual-order-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0284c7;
    background-color: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 3px;
}

/* Form Inputs */
.config-input,
.config-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #2d3748;
    background-color: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.config-input:hover,
.config-textarea:hover {
    border-color: #a0aec0;
}

.config-input:focus,
.config-textarea:focus {
    outline: none;
    border-color: #fbb44c;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.1);
}

.config-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkout Button */
.btn-checkout {
    width: 100%;
    padding: 1rem 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(135deg, #3d4348 0%, #2d3238 100%);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-checkout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-checkout:active:not(:disabled) {
    transform: translateY(0);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================
   Preview
   =================================== */

#preview-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Placeholder State */
.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.preview-placeholder-icon {
    width: 64px;
    height: 64px;
    color: #9ca3af;
}

.preview-placeholder-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #9ca3af;
    margin: 0;
}

/* Image Preview */
.preview-image-container {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.preview-image {
    display: block;
    max-width: 100%;
    height: auto;
}

/* File Preview (for PDF/TIFF) */
.preview-file-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.file-icon {
    width: 64px;
    height: 64px;
    color: #718096;
    flex-shrink: 0;
}

.file-notice-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.file-notice-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0;
    word-break: break-word;
    max-width: 100%;
}

.file-notice-hint {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

/* Float Style - Shadow effect */
.style-float {
    padding: 25px;
}

.style-float .preview-image {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    max-height: 90%;
}

/* UnFramed Plus 1.25" - Same shadow as float */
.style-unframed-plus-125 {
    padding: 25px;
}

.style-unframed-plus-125 .preview-image {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    max-height: 90%;
}

/* UnFramed Plus 2.0" - Same shadow as float */
.style-unframed-plus-200 {
    padding: 25px;
}

.style-unframed-plus-200 .preview-image {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    max-height: 90%;
}

/* Plaque Style - Same shadow as float */
.style-plaque {
    padding: 25px;
}

.style-plaque .preview-image {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    max-height: 90%;
}

/* ===================================
   Responsive Adjustments
   =================================== */

@media (max-width: 991px) {
    /* On mobile, show upload at top, then preview, then configuration */
    .configurator-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .configurator-sidebar {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        max-width: 100%;
    }

    #photo-upload-container {
        order: -2;
        width: 100%;
        max-width: 100%;
    }

    .configurator-main {
        order: -1;
        position: static;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: unset;
        max-height: unset;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1rem;
        overflow: visible;
    }

    #preview-container {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: unset;
        max-height: unset;
        overflow: visible;
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .preview-image-container {
        width: auto;
        max-width: 100%;
        height: auto;
        display: inline-block;
    }

    .preview-image {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 50vh;
        display: block;
    }

    /* All mount styles use shadow - adjust for mobile */
    .style-float .preview-image,
    .style-unframed-plus-125 .preview-image,
    .style-unframed-plus-200 .preview-image,
    .style-plaque .preview-image {
        max-width: 90%;
        max-height: calc(50vh - 50px);
    }

    .configurator-main.hidden {
        display: none;
    }

    #configuration-container {
        order: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Ensure image preview doesn't expand beyond filename */
    .image-preview {
        max-width: 100%;
        overflow: hidden;
    }

    .image-name {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .price-value {
        font-size: 2rem;
    }

    /* Mobile: hide config and preview when no photos */
    .configurator-grid.no-photos .configurator-main {
        display: none;
    }

    .configurator-grid.no-photos #configuration-container {
        display: none;
    }
}

@media (max-width: 576px) {
    .upload-configurator {
        padding: 1rem 0.5rem;
    }

    .dropzone {
        padding: 1.5rem 1rem;
    }

    .dropzone-icon {
        width: 36px;
        height: 36px;
    }

    .price-value {
        font-size: 1.75rem;
    }

    .finish-options {
        gap: 0.5rem;
    }

    .finish-option {
        padding: 0.65rem 0.85rem;
    }

    .finish-color {
        width: 28px;
        height: 28px;
    }

    .finish-label {
        font-size: 0.85rem;
    }
}

/* ===================================
   Stripe Checkout Modal
   =================================== */

#stripe-checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.checkout-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.checkout-modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.checkout-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f7fafc;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-modal-close:hover {
    background-color: #e2e8f0;
    transform: scale(1.1);
}

#checkout-container {
    padding: 2rem;
    min-height: 400px;
}

.checkout-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.checkout-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #fbb44c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.checkout-loading p {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #718096;
    margin: 0;
}

@media (max-width: 768px) {
    .checkout-modal-overlay {
        padding: 1rem;
    }

    .checkout-modal-content {
        max-height: 95vh;
    }

    #checkout-container {
        padding: 1.5rem;
    }

    .checkout-loading {
        min-height: 300px;
    }

    .checkout-loading .spinner {
        width: 40px;
        height: 40px;
    }
}

/* ===================================
   Utility Classes
   =================================== */

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.slide-up {
    animation: slideUp 0.3s ease;
}

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

/* ===================================
   Photo Thumbnails Strip
   =================================== */

.photo-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #f7fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Desktop: 5 items per row grid layout */
@media (min-width: 992px) {
    .photo-thumbnails {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
    }
}

/* Mobile: horizontal scroll */
@media (max-width: 991px) {
    .photo-thumbnails {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.photo-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.photo-thumbnails::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 3px;
}

.photo-thumbnails::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.photo-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.thumbnail {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background-color: #e2e8f0;
}

/* Desktop grid: thumbnails fill the grid cell */
@media (min-width: 992px) {
    .thumbnail {
        width: 100%;
        height: 0;
        padding-bottom: 100%; /* Square aspect ratio */
    }

    .thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
    }

    .thumbnail-file-icon {
        position: absolute;
        top: 0;
        left: 0;
    }

    .thumbnail-remove {
        z-index: 10;
    }
}

.thumbnail:hover {
    border-color: #cbd5e0;
}

.thumbnail.active {
    border-color: #fbb44c;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.3);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e2e8f0;
}

.thumbnail-file-icon svg {
    width: 32px;
    height: 32px;
    color: #718096;
}

.thumbnail-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.thumbnail-remove svg {
    width: 12px;
    height: 12px;
}

.thumbnail:hover .thumbnail-remove {
    opacity: 1;
}

.thumbnail-remove:hover {
    background: rgba(220, 38, 38, 0.9);
}

.thumbnail-add {
    width: 70px;
    height: 70px;
    border: 2px dashed #cbd5e0;
    border-radius: 6px;
    background: transparent;
    color: #a0aec0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

/* Desktop grid: add button fills the grid cell */
@media (min-width: 992px) {
    .thumbnail-add {
        width: 100%;
        height: 0;
        padding-bottom: 100%; /* Square aspect ratio */
        position: relative;
    }

    .thumbnail-add svg {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

.thumbnail-add svg {
    width: 24px;
    height: 24px;
}

.thumbnail-add:hover {
    border-color: #fbb44c;
    color: #fbb44c;
    background-color: rgba(251, 180, 76, 0.05);
}

/* ===================================
   Order Summary
   =================================== */

.order-summary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.order-summary-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #3d4348;
    margin: 0 0 1rem 0;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #f7fafc;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.order-item:hover {
    background-color: #fff;
    border-color: #e2e8f0;
}

.order-item.active {
    background-color: #fff;
    border-color: #fbb44c;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.1);
}

.order-item .item-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #e2e8f0;
}

.order-item .item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item .item-thumbnail .thumbnail-file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-item .item-thumbnail .thumbnail-file-icon svg {
    width: 24px;
    height: 24px;
    color: #718096;
}

.order-item .item-details {
    flex: 1;
    min-width: 0;
}

.order-item .item-name {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item .item-config {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    margin-top: 2px;
}

.order-item .item-config.item-not-configured {
    color: #f59e0b;
    font-style: italic;
}

.order-item .item-price {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #27ae60;
    flex-shrink: 0;
}

.order-item .item-price .quote-needed {
    font-size: 0.8rem;
    color: #f59e0b;
    font-weight: 500;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fbb44c 0%, #f39c12 100%);
    border-radius: 8px;
}

.order-total .total-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.order-total .total-price {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* Pricing Disclaimer */
.pricing-disclaimer {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    color: #718096;
    text-align: center;
    margin: 0.75rem 0 0 0;
    padding: 0.75rem;
    background-color: #f7fafc;
    border-radius: 6px;
    line-height: 1.5;
    font-style: italic;
}

.pricing-disclaimer.checkout-disclaimer {
    margin-bottom: 1.5rem;
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* ===================================
   Customer Form
   =================================== */

.customer-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.customer-form-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #3d4348;
    margin: 0 0 1rem 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row-three {
    grid-template-columns: 1fr auto auto;
}

.shipping-fields {
    margin-bottom: 0.75rem;
    padding: 1rem;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.shipping-fields-label {
    font-weight: 600;
    margin-bottom: 0.75rem !important;
}

.shipping-fields .config-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: #718096;
}

.shipping-fields .form-group {
    margin-bottom: 0.5rem;
}

.config-textarea-compact {
    min-height: 2.25rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.9rem;
    line-height: 1.3;
    resize: vertical;
}

.pickup-or-ship-hint {
    margin: 0.5rem 0 1rem;
    padding: 0.6rem 0.85rem;
    background-color: #fff8e1;
    border-left: 3px solid #fbb44c;
    color: #3d4348;
    font-size: 0.9rem;
    border-radius: 4px;
}

/* Delivery Method Toggle (Pick Up vs Ship to Me) */
.delivery-method-section {
    margin: 1rem 0 1.25rem;
}

.delivery-method-label {
    margin-bottom: 0.6rem !important;
    font-weight: 600;
}

.delivery-method-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.delivery-method-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background-color: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    margin: 0;
}

.delivery-method-option:hover {
    border-color: #fbb44c;
}

.delivery-method-option.is-selected {
    border-color: #fbb44c;
    background-color: #fff8e1;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.15);
}

.delivery-method-option input[type="radio"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #fbb44c;
    flex-shrink: 0;
}

.delivery-method-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    line-height: 1.3;
}

.delivery-method-option-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #3d4348;
}

.delivery-method-option-desc {
    font-size: 0.85rem;
    color: #718096;
}

.delivery-method-fields {
    margin-bottom: 0.75rem;
}

.delivery-method-fields-pickup {
    padding: 1rem;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

@media (max-width: 540px) {
    .delivery-method-options {
        grid-template-columns: 1fr;
    }
}

.found-via-group {
    margin-top: 0.75rem;
}

.found-via-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 0.25rem;
}

.found-via-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: #3d4348;
    cursor: pointer;
    margin: 0;
}

.found-via-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

#customer-state {
    width: 80px;
}

#customer-zip {
    width: 110px;
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row-three {
        grid-template-columns: 1fr 1fr;
    }

    .form-row-three .form-group:first-child {
        grid-column: 1 / -1;
    }

    #customer-state,
    #customer-zip {
        width: 100%;
    }
}

/* ===================================
   Active Photo Configuration
   =================================== */

.active-photo-config {
    margin-bottom: 0;
}

.config-section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #3d4348;
    margin: 0 0 1rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price-section {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
}

.item-price-section .price-label {
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
    font-weight: 700;
}

.item-price-section .price-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.item-price-section .price-breakdown-row {
    font-weight: 700;
}

.item-price-section .price-breakdown-total {
    font-weight: 800;
}

/* Price breakdown for mounted items */
.price-breakdown {
    margin-top: 0.25rem;
}

.price-breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.15rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.price-breakdown-total {
    display: flex;
    justify-content: space-between;
    padding-top: 0.35rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.15));
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.breakdown-label {
    opacity: 1;
}

.price-breakdown-total .breakdown-label {
    opacity: 1;
}

/* ===================================
   Order Confirmation
   =================================== */

.order-confirmation {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.order-confirmation .confirmation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.order-confirmation h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #3d4348;
    margin: 0 0 1rem 0;
}

.order-confirmation p {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #718096;
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.order-confirmation .btn-new-order {
    margin-top: 2rem;
    padding: 0.875rem 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fbb44c;
    background: transparent;
    border: 2px solid #fbb44c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.order-confirmation .btn-new-order:hover {
    background-color: #fbb44c;
    color: #fff;
}


/* ===================================
   Thumbnail Modal / Lightbox
   =================================== */

.thumbnail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.thumbnail-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.thumbnail-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.thumbnail-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.thumbnail-modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.thumbnail-modal-label {
    font-family: 'Poppins', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin-top: 1rem;
}

/* Mobile adjustments for thumbnails */
@media (max-width: 576px) {
    .thumbnail-modal-overlay {
        padding: 1rem;
    }

    .thumbnail-modal-close {
        top: -36px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .style-option {
        padding: 0.625rem 0.75rem;
    }

    .style-option-label {
        font-size: 0.85rem;
    }

    .style-option .rotator-preview-btn {
        width: 32px;
        min-height: 32px;
    }

    .style-option .rotator-preview-btn svg {
        width: 16px;
        height: 16px;
    }

    .finish-thumbnail-img {
        width: 38px;
        height: 38px;
    }

    .finish-checkbox {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .finish-preview-hint {
        display: none;
    }
}

/* ===================================
   360 Rotator Modal
   =================================== */

.rotator-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rotator-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.rotator-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 600px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.rotator-modal-overlay.active .rotator-modal-content {
    transform: scale(1);
}

.rotator-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    transition: all 0.2s ease;
}

.rotator-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.rotator-modal-title {
    padding: 1.25rem 3rem 0 1.5rem;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #3d4348;
}

.rotator-modal-subtitle {
    padding: 0.25rem 1.5rem 1rem 1.5rem;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: #6b7280;
    border-bottom: 1px solid #e2e8f0;
}

.rotator-modal-body {
    padding: 0;
}

/* Modal Rotator Specific Overrides */
.rotator-modal-content .theunframer-product-360-rotator {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

.rotator-modal-content .product-360-container {
    border-radius: 0;
    box-shadow: none;
}

.rotator-modal-content .product-360-viewer {
    cursor: grab;
    position: relative;
    width: 100%;
    padding-bottom: 66.67%; /* 3:2 aspect ratio for better fit */
    overflow: hidden;
}

.rotator-modal-content .product-360-viewer:active {
    cursor: grabbing;
}

.rotator-modal-content .product-360-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.rotator-modal-content .product-360-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.rotator-modal-content .product-360-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #fbb44c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

.rotator-modal-content .product-360-loading p {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #718096;
    margin: 0;
}

.rotator-modal-content .product-360-controls {
    padding: 1rem 1.5rem;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

.rotator-modal-content .product-360-hint {
    text-align: center;
    margin-bottom: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: #718096;
}

.rotator-modal-content .scrubber-track {
    position: relative;
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
}

.rotator-modal-content .scrubber-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #fbb44c, #f39c12);
    border-radius: 5px;
    pointer-events: none;
    transition: width 0.05s ease;
}

.rotator-modal-content .scrubber-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: #fff;
    border: 3px solid #fbb44c;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
    z-index: 2;
}

.rotator-modal-content .scrubber-handle:hover,
.rotator-modal-content .scrubber-handle:focus {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    outline: none;
}

.rotator-modal-content .scrubber-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.rotator-modal-content .scrubber-handle:focus {
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.3);
}

/* 360 Rotator Preview Button */
.rotator-preview-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    min-height: 50px;
    padding: 0;
    background-color: #f7fafc;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rotator-preview-btn:hover {
    background-color: #fbb44c;
    border-color: #fbb44c;
    color: #fff;
}

.rotator-preview-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile adjustments for rotator modal */
@media (max-width: 640px) {
    .rotator-modal-content {
        width: 95vw;
        max-height: 95vh;
    }

    .rotator-modal-title {
        padding: 1rem 2.5rem 0 1rem;
        font-size: 1.1rem;
    }

    .rotator-modal-subtitle {
        padding: 0.25rem 1rem 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .rotator-modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }

    .rotator-modal-content .product-360-controls {
        padding: 0.75rem 1rem;
    }

    .rotator-modal-content .scrubber-handle {
        width: 20px;
        height: 20px;
    }

    .rotator-preview-btn {
        width: 44px;
        min-height: 44px;
    }

    .rotator-preview-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ===================================
   Image Quality Meter
   =================================== */

.quality-meter-container {
    margin-top: 0.75rem;
}

.quality-meter-label {
    margin-bottom: 0.5rem;
}

.quality-meter {
    position: relative;
}

.quality-meter-bar {
    position: relative;
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(to right, #ef4444 0%, #ef4444 33.33%, #eab308 33.33%, #eab308 66.66%, #22c55e 66.66%, #22c55e 100%);
    overflow: visible;
}

.quality-meter-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    transition: left 0.3s ease;
    z-index: 1;
}

.quality-meter-labels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: #2d3748;
    font-family: 'Poppins', sans-serif;
}

/* ===================================
   Two-Step Checkout
   =================================== */

/* Checkout Mode - Grid Layout */
.configurator-grid.checkout-mode {
    grid-template-columns: 1fr;
    max-width: 700px;
    margin: 0 auto;
}

.configurator-grid.checkout-mode .configurator-sidebar {
    width: 100%;
}

.configurator-sidebar.checkout-expanded {
    width: 100%;
}

.configurator-main.hidden-for-checkout {
    display: none !important;
}

/* Hide upload container in checkout mode */
.configurator-grid.checkout-mode #photo-upload-container {
    display: none;
}

/* Checkout Header (Step 2) */
.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #3d4348 0%, #2d3238 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.checkout-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.checkout-summary-mini {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mini-summary-items {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.mini-summary-total {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fbb44c;
}

/* Checkout Items Summary */
.checkout-items-summary {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.checkout-items-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #3d4348;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.checkout-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
}

.checkout-item-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e2e8f0;
}

.checkout-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkout-item-file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkout-item-file-icon svg {
    width: 24px;
    height: 24px;
    color: #718096;
}

.checkout-item-info {
    flex: 1;
    min-width: 0;
}

.checkout-item-name {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkout-item-config {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-top: 2px;
}

.checkout-item-price {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #27ae60;
    flex-shrink: 0;
}

.checkout-item-price .quote-tag {
    font-size: 0.85rem;
    color: #f59e0b;
    font-weight: 500;
    background: #fef3c7;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Customer Form - Enhanced styling */
.checkout-mode .customer-form,
.checkout-step .customer-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 0;
    border-top: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.checkout-mode .customer-form-title,
.checkout-step .customer-form-title {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.checkout-mode .form-row,
.checkout-step .form-row {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkout-mode .form-group,
.checkout-step .form-group {
    margin-bottom: 1rem;
}

.checkout-mode .config-label,
.checkout-step .config-label {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.checkout-mode .config-input,
.checkout-mode .config-textarea,
.checkout-step .config-input,
.checkout-step .config-textarea {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.checkout-mode .config-input:focus,
.checkout-mode .config-textarea:focus,
.checkout-step .config-input:focus,
.checkout-step .config-textarea:focus {
    border-color: #fbb44c;
    box-shadow: 0 0 0 4px rgba(251, 180, 76, 0.15);
}

.checkout-mode .config-textarea,
.checkout-step .config-textarea {
    min-height: 100px;
}

/* Checkout Buttons Container (Step 2) */
.checkout-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Back Button */
.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    background-color: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-back:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

.btn-back svg {
    flex-shrink: 0;
}

/* Top Back Button (Step 2) */
.btn-back-top {
    margin: 0;
    align-self: flex-start;
}

.checkout-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.checkout-add-gallery {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.checkout-add-gallery-text {
    font-size: 0.9rem;
    color: #4a5568;
}

.btn-checkout-gallery {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #3d4348;
    background-color: #fff;
    color: #3d4348;
    cursor: pointer;
}

.btn-checkout-gallery:hover {
    background-color: #f7fafc;
}

@media (max-width: 576px) {
    .checkout-header-top {
        flex-direction: column;
        align-items: stretch;
    }
    .checkout-add-gallery {
        justify-content: space-between;
    }
}

/* Proceed Button (Step 1) */
.btn-proceed {
    margin-top: 1.5rem;
}

.btn-proceed.needs-config {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    cursor: pointer;
}

.btn-proceed.needs-config:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

/* Place Order Button (Step 2) */
.btn-place-order {
    flex: 1;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
}

.btn-place-order:hover:not(:disabled) {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

/* Responsive adjustments for checkout */
@media (max-width: 768px) {
    .configurator-grid.checkout-mode {
        max-width: 100%;
    }

    .checkout-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.25rem 1.5rem;
    }

    .checkout-title {
        font-size: 1.25rem;
    }

    .checkout-summary-mini {
        width: 100%;
        justify-content: space-between;
    }

    .mini-summary-total {
        font-size: 1.5rem;
    }

    .checkout-mode .customer-form,
    .checkout-step .customer-form {
        padding: 1.5rem;
    }

    .checkout-mode .form-row,
    .checkout-step .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .checkout-mode .form-row-three,
    .checkout-step .form-row-three {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .checkout-mode .form-row-three .form-group:first-child,
    .checkout-step .form-row-three .form-group:first-child {
        grid-column: 1 / -1;
    }

    .checkout-buttons {
        flex-direction: column;
    }

    .btn-back {
        order: 1;
    }

    .btn-place-order {
        order: 0;
    }

    .checkout-items-summary {
        padding: 1.25rem;
    }

    .checkout-item {
        padding: 0.625rem;
        gap: 0.75rem;
    }

    .checkout-item-thumb {
        width: 40px;
        height: 40px;
    }

    .checkout-item-name {
        font-size: 0.85rem;
    }

    .checkout-item-config {
        font-size: 0.75rem;
    }

    .checkout-item-price {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .checkout-header {
        padding: 1rem 1.25rem;
    }

    .checkout-mode .customer-form,
    .checkout-step .customer-form {
        padding: 1.25rem;
        border-radius: 8px;
    }

    .checkout-mode .config-input,
    .checkout-mode .config-textarea,
    .checkout-step .config-input,
    .checkout-step .config-textarea {
        padding: 0.875rem 1rem;
    }

    .checkout-items-summary {
        padding: 1rem;
        border-radius: 8px;
    }
}

/* ===================================
   Upload Options Layout (Dropzone + Gallery side by side)
   =================================== */

.upload-options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.upload-options-container .dropzone {
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
}

.upload-options-container .gallery-choose-section {
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    flex-direction: column;
}

/* Mobile: stack vertically */
@media (max-width: 767px) {
    .upload-options-container {
        grid-template-columns: 1fr;
    }

    .upload-options-container .dropzone {
        min-height: 160px;
    }
}

/* ===================================
   Gallery Choose Button Section
   =================================== */

.gallery-choose-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e2e8f0;
}

/* Hide divider when in side-by-side layout */
.upload-options-container .gallery-choose-divider {
    display: none;
}

.gallery-choose-divider {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #a0aec0;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery-choose-divider::before,
.gallery-choose-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.gallery-choose-divider span {
    padding: 0 1rem;
}

.btn-choose-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3d4348;
    background-color: #fff;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

/* When in side-by-side layout, make gallery button fill the space */
.upload-options-container .btn-choose-gallery {
    height: 100%;
    min-height: 200px;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #f7fafc;
}

.upload-options-container .btn-choose-gallery svg {
    width: 48px;
    height: 48px;
    color: #a0aec0;
}

.upload-options-container .btn-choose-gallery:hover svg {
    color: #fbb44c;
}

@media (max-width: 767px) {
    .upload-options-container .btn-choose-gallery {
        min-height: 120px;
    }

    .upload-options-container .btn-choose-gallery svg {
        width: 36px;
        height: 36px;
    }
}

/* Compact mode for "add more photos" state */
.upload-options-container.compact-mode .dropzone {
    min-height: 100px;
    padding: 1rem;
}

.upload-options-container.compact-mode .dropzone-icon {
    width: 32px;
    height: 32px;
}

.upload-options-container.compact-mode .dropzone-text {
    font-size: 0.9rem;
}

.upload-options-container.compact-mode .btn-choose-gallery {
    min-height: 100px;
}

.upload-options-container.compact-mode .btn-choose-gallery svg {
    width: 32px;
    height: 32px;
}

@media (max-width: 767px) {
    .upload-options-container.compact-mode .dropzone,
    .upload-options-container.compact-mode .btn-choose-gallery {
        min-height: 80px;
    }
}

/* Standalone cancel button (below upload options) */
.dropzone-cancel-standalone {
    display: block;
    margin: 0.75rem auto 0;
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    color: #718096;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dropzone-cancel-standalone:hover {
    border-color: #a0aec0;
    color: #4a5568;
    background-color: #f7fafc;
}

.btn-choose-gallery:hover {
    border-color: #fbb44c;
    background-color: #fff;
    color: #fbb44c;
}

.btn-choose-gallery:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-choose-gallery:disabled:hover {
    border-color: #cbd5e0;
    background-color: #f7fafc;
    color: #3d4348;
}

.btn-choose-gallery svg {
    width: 20px;
    height: 20px;
}

/* ===================================
   Gallery Modal
   =================================== */

.gallery-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.gallery-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.gallery-modal-overlay.active .gallery-modal-content {
    transform: scale(1);
}

/* Modal Header */
.gallery-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 4rem 1.25rem 1.5rem;
    background: linear-gradient(135deg, #3d4348 0%, #2d3238 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.gallery-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.gallery-modal-slots {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slots-available {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.slots-selected {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fbb44c;
    background: rgba(251, 180, 76, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.gallery-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Modal Filters */
.gallery-modal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group.filter-search {
    flex: 2;
    min-width: 200px;
}

.filter-select,
.filter-input {
    width: 100%;
    height: 42px;
    padding: 0 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    line-height: 42px;
    color: #2d3748;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.filter-input {
    line-height: normal;
    padding: 0.65rem 1rem;
}

.filter-select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    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='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.filter-select:hover,
.filter-input:hover {
    border-color: #cbd5e0;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #fbb44c;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.1);
}

/* Modal Body */
.gallery-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 300px;
}

/* Gallery Grid */
.gallery-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.gallery-modal-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
    background: #f7fafc;
}

.gallery-modal-item:hover {
    border-color: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-modal-item.selected {
    border-color: #fbb44c;
    box-shadow: 0 0 0 3px rgba(251, 180, 76, 0.3);
}

.gallery-modal-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gallery-modal-item.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.gallery-item-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #e2e8f0;
}

.gallery-item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-item-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: #fbb44c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.gallery-item-check svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.gallery-item-info {
    padding: 0.75rem;
    background: #fff;
}

.gallery-item-title {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-photographer {
    display: block;
    font-size: 0.7rem;
    color: #718096;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading State */
.gallery-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.gallery-modal-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #fbb44c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.gallery-modal-loading p {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #718096;
    margin: 0;
}

/* Empty State */
.gallery-modal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.gallery-modal-empty .empty-icon {
    width: 64px;
    height: 64px;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.gallery-modal-empty p {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #718096;
    margin: 0 0 1rem 0;
}

.btn-clear-filters {
    padding: 0.5rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fbb44c;
    background: transparent;
    border: 1px solid #fbb44c;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #fbb44c;
    color: #fff;
}

/* Load More */
.gallery-modal-sentinel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 64px;
    padding: 1rem 0 0.5rem;
}

.gallery-modal-sentinel-end {
    display: none;
    color: #718096;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

.gallery-modal-sentinel-spinner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #4a5568;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.gallery-modal-sentinel-spinner.is-visible {
    opacity: 1;
}

.gallery-modal-sentinel-spinner .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #fbb44c;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.gallery-modal-load-more {
    display: flex;
    justify-content: center;
    padding-top: 1.5rem;
}

.btn-load-more {
    padding: 0.75rem 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3d4348;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover:not(:disabled) {
    border-color: #fbb44c;
    background: #fff;
    color: #fbb44c;
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal Footer */
.gallery-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.btn-cancel {
    padding: 0.75rem 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-add-selected {
    padding: 0.75rem 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #fbb44c 0%, #f39c12 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-selected:hover:not(:disabled) {
    background: linear-gradient(135deg, #f9a825 0%, #e8890c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 180, 76, 0.4);
}

.btn-add-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Gallery Modal */
@media (max-width: 992px) {
    .gallery-modal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .gallery-modal-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 3rem 1rem 1rem;
    }

    .gallery-modal-title {
        font-size: 1.1rem;
    }

    .gallery-modal-slots {
        width: 100%;
        justify-content: space-between;
    }

    .gallery-modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .gallery-modal-filters {
        padding: 0.75rem 1rem;
    }

    .filter-group {
        min-width: 120px;
    }

    .filter-group.filter-search {
        flex: 100%;
        min-width: 100%;
    }

    .gallery-modal-body {
        padding: 1rem;
    }

    .gallery-modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .gallery-item-info {
        padding: 0.5rem;
    }

    .gallery-item-title {
        font-size: 0.75rem;
    }

    .gallery-item-photographer {
        font-size: 0.65rem;
    }

    .gallery-modal-footer {
        padding: 0.75rem 1rem;
    }

    .btn-cancel,
    .btn-add-selected {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .gallery-modal-overlay {
        padding: 0.5rem;
    }

    .gallery-modal-content {
        max-height: 98vh;
        border-radius: 8px;
    }

    .gallery-modal-grid {
        gap: 0.5rem;
    }

    .gallery-item-check {
        width: 24px;
        height: 24px;
        top: 4px;
        right: 4px;
    }

    .gallery-item-check svg {
        width: 14px;
        height: 14px;
    }

    .gallery-modal-footer {
        flex-direction: column;
    }

    .btn-cancel {
        order: 1;
    }

    .btn-add-selected {
        order: 0;
        width: 100%;
    }
}
