/**
 * Donation Modal - Multi-step Gift Ordering Styles
 */

/* Modal Overlay */
.gift-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.gift-modal-overlay.active {
    display: flex;
}

/* Modal Container */
.gift-modal {
    background: var(--nf-card, #fff);
    border-radius: 12px;
    max-width: 620px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-steps {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Progress Indicator */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--nf-border-light, #e0e0e0);
    background: var(--nf-surface, #f8f9fa);
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--nf-border, #ccc);
    transition: all 0.2s ease;
}

.progress-dot.active {
    background: var(--nf-navy, #2c3e50);
    transform: scale(1.3);
}

.progress-dot.completed {
    background: #27ae60;
}

.step-title {
    margin-left: 12px;
    font-size: 13px;
    color: var(--nf-muted, #666);
    text-transform: capitalize;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--nf-border-light, #e0e0e0);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--nf-navy, #2c3e50);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--nf-muted, #666);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: var(--nf-navy, #2c3e50);
}

/* Steps */
.modal-step {
    display: none;
}

.modal-step.active {
    display: block;
}

/* Step Titles */
.step-title-main {
    margin: 0 0 8px;
    font-size: 22px;
    color: var(--nf-navy, #2c3e50);
}

.step-subtitle {
    margin: 0 0 20px;
    color: var(--nf-muted, #666);
    font-size: 14px;
}

/* Order Type Cards */
.order-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.order-type-card {
    border: 2px solid var(--nf-border-light, #e0e0e0);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: var(--nf-card, #fff);
}

.order-type-card:hover {
    border-color: var(--nf-navy, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.order-type-card.selected {
    border-color: var(--nf-navy, #2c3e50);
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.05), rgba(119, 102, 173, 0.05));
}

.order-type-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.order-type-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--nf-navy, #2c3e50);
}

.order-type-card p {
    margin: 0;
    font-size: 12px;
    color: var(--nf-muted, #666);
}

/* Product Options */
.product-section {
    display: none;
    margin-top: 20px;
}

.product-section.active {
    display: block;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.product-option {
    border: 1px solid var(--nf-border-light, #e0e0e0);
    border-radius: 10px;
    padding: 14px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: var(--nf-card, #fff);
}

.product-option:hover {
    border-color: var(--nf-navy, #2c3e50);
}

.product-option.selected {
    border-color: var(--nf-navy, #2c3e50);
    background: var(--nf-yellow, #f6c243);
}

.product-option-name {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--nf-navy, #2c3e50);
    margin-bottom: 4px;
}

.product-price {
    font-size: 12px;
    color: var(--nf-muted, #666);
}

/* Size Tiers */
.size-tiers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.size-tier-btn {
    flex: 1;
    min-width: 70px;
    padding: 12px 16px;
    border: 1px solid var(--nf-border-light, #e0e0e0);
    border-radius: 8px;
    background: var(--nf-card, #fff);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    font-weight: 700;
    font-size: 13px;
}

.size-tier-btn:hover {
    border-color: var(--nf-navy, #2c3e50);
}

.size-tier-btn.selected {
    background: var(--nf-navy, #2c3e50);
    color: #fff;
    border-color: var(--nf-navy, #2c3e50);
}

.size-tier-price {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 2px;
}

/* Color Swatches */
.color-preference {
    margin-top: 16px;
}

.color-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--nf-navy, #2c3e50);
}

.color-swatch[data-color="red"] { background: #e74c3c; }
.color-swatch[data-color="pink"] { background: #ff69b4; }
.color-swatch[data-color="purple"] { background: #9b59b6; }
.color-swatch[data-color="white"] { background: #fff; border-color: #ccc; }
.color-swatch[data-color="yellow"] { background: #f1c40f; }
.color-swatch[data-color="orange"] { background: #e67e22; }
.color-swatch[data-color="blue"] { background: #3498db; }

/* Form Fields */
.modal-field {
    margin-top: 16px;
}

.modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--nf-muted, #666);
    margin-bottom: 6px;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--nf-border-light, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    background: var(--nf-surface, #f8f9fa);
    color: var(--nf-ink, #333);
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
    outline: none;
    border-color: var(--nf-navy, #2c3e50);
}

.modal-field textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-field .required {
    color: #c53030;
}

/* Form Grid */
.modal-field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modal-field-grid-full {
    grid-template-columns: 1fr;
}

/* Occasion Dropdown */
.occasion-select {
    padding: 10px 12px;
    font-size: 14px;
}

/* Checkbox */
.modal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 10px;
    border-radius: 8px;
    background: var(--nf-surface, #f8f9fa);
}

.modal-checkbox input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.modal-checkbox label {
    font-size: 14px;
    color: var(--nf-navy, #2c3e50);
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

/* Custom Notes */
.custom-notes {
    margin-top: 16px;
}

/* Character Counter */
.char-counter {
    font-size: 12px;
    color: var(--nf-muted, #666);
    text-align: right;
    margin-top: 4px;
}

/* Product Price Display */
.selected-price {
    font-size: 24px;
    font-weight: 900;
    color: var(--nf-navy, #2c3e50);
    text-align: center;
    margin-top: 16px;
    padding: 12px;
    background: var(--nf-surface, #f8f9fa);
    border-radius: 8px;
}

/* Review Section */
.review-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--nf-border-light, #e0e0e0);
}

.review-section h4 {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--nf-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-section p {
    margin: 0;
    font-size: 14px;
    color: var(--nf-navy, #2c3e50);
}

.review-total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid var(--nf-border, #ccc);
}

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

.price-row.total {
    font-size: 18px;
    font-weight: 900;
    color: var(--nf-navy, #2c3e50);
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--nf-border, #ccc);
}

/* Stripe Payment */
.stripe-payment-element {
    padding: 16px;
    border: 1px solid var(--nf-border-light, #e0e0e0);
    border-radius: 8px;
    background: #fff;
    margin-top: 16px;
}

/* Confirmation */
.confirmation-details {
    text-align: center;
    padding: 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #27ae60;
    color: #fff;
    font-size: 40px;
    line-height: 80px;
    margin: 0 auto 16px;
}

.confirmation-details h3 {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--nf-navy, #2c3e50);
}

.confirmation-details p {
    margin: 0 0 8px;
    color: var(--nf-muted, #666);
}

.order-reference {
    font-size: 16px;
    padding: 12px;
    background: var(--nf-surface, #f8f9fa);
    border-radius: 8px;
    margin: 16px 0 !important;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--nf-border-light, #e0e0e0);
    background: var(--nf-surface, #f8f9fa);
}

.btn-prev,
.btn-next {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-prev {
    background: none;
    border: 1px solid var(--nf-border, #ccc);
    color: var(--nf-muted, #666);
}

.btn-prev:hover {
    border-color: var(--nf-navy, #2c3e50);
    color: var(--nf-navy, #2c3e50);
}

.btn-next {
    background: var(--nf-navy, #2c3e50);
    border: none;
    color: #fff;
}

.btn-next:hover {
    background: #34495e;
}

.btn-submit {
    background: linear-gradient(180deg, #e64444, #b21f1f);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(230, 68, 68, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(230, 68, 68, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Message */
.modal-error {
    display: none;
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #c53030;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 600px) {
    .order-type-grid {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-field-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

/* Utility */
.hidden {
    display: none !important;
}

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

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

.gift-modal {
    animation: slideUp 0.3s ease;
}

/* Backdrop blur effect */
.gift-modal-overlay {
    backdrop-filter: blur(4px);
}

/* ============================================
   DEDICATION MODAL - Single Form Layout
   ============================================ */

/* Modal Overlay for Dedication Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

/* Modal Content - Dedicated Donation */
.dedication-modal-content {
    background: var(--nf-card, #fff);
    border-radius: 12px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

/* Header */
.dedication-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--nf-border-light, #e0e0e0);
}

.dedication-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--nf-navy, #2c3e50);
}

.dedication-subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--nf-muted, #666);
}

.dedication-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--nf-muted, #666);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s ease;
}

.dedication-modal-close:hover {
    color: var(--nf-navy, #2c3e50);
}

/* Body */
.dedication-modal-body {
    padding: 20px 24px;
}

/* Sections */
.dedication-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--nf-border-light, #e0e0e0);
}

.dedication-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dedication-section-label {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nf-navy, #2c3e50);
    border-bottom: 1px solid var(--nf-border-light, #e0e0e0);
    padding-bottom: 8px;
}

.dedication-section-intro {
    margin: -8px 0 16px;
    font-size: 14px;
    color: var(--nf-muted, #666);
}

/* Fields */
.dedication-field {
    margin-top: 14px;
}

.dedication-field:first-child {
    margin-top: 0;
}

.dedication-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--nf-muted, #666);
    margin-bottom: 6px;
}

.dedication-field input,
.dedication-field select,
.dedication-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--nf-border-light, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    background: var(--nf-surface, #f8f9fa);
    color: var(--nf-ink, #333);
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.dedication-field input:focus,
.dedication-field select:focus,
.dedication-field textarea:focus {
    outline: none;
    border-color: var(--nf-navy, #2c3e50);
}

.dedication-field .required {
    color: #c53030;
}

/* Field Row */
.dedication-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* Type Toggle */
.dedication-type-toggle {
    display: flex;
    gap: 10px;
}

.dedication-type-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--nf-border, #ccc);
    border-radius: 999px;
    background: var(--nf-card, #fff);
    color: var(--nf-navy, #2c3e50);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dedication-type-btn:hover {
    background: var(--nf-navy, #2c3e50);
    color: #fff;
    border-color: var(--nf-navy, #2c3e50);
}

.dedication-type-btn.is-on {
    background: var(--nf-navy, #2c3e50);
    color: #fff;
    border-color: var(--nf-navy, #2c3e50);
}

/* Checkboxes */
.dedication-checkbox-group {
    margin-bottom: 12px;
}

.dedication-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dedication-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.dedication-checkbox label {
    font-size: 14px;
    color: var(--nf-navy, #2c3e50);
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

/* Pill-style Add-on Toggles - Optional enhancements */
.dedication-section .dedication-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dedication-section .dedication-checkbox {
    padding: 10px 16px;
    border: 1px solid var(--nf-border, #ccc);
    border-radius: 20px;
    background: var(--nf-card, #fff);
    transition: all 0.15s ease;
    cursor: pointer;
}

.dedication-section .dedication-checkbox:hover {
    border-color: var(--nf-navy, #2c3e50);
}

.dedication-section .dedication-checkbox:has(input:checked) {
    background: var(--nf-navy, #2c3e50);
    border-color: var(--nf-navy, #2c3e50);
}

.dedication-section .dedication-checkbox:has(input:checked) label {
    color: #fff;
}

.dedication-section .dedication-checkbox:has(input:checked) input {
    accent-color: #fff;
}

/* Conditional Fields */
.dedication-conditional-fields {
    padding: 14px;
    margin-top: 10px;
    background: var(--nf-surface, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--nf-border-light, #e0e0e0);
}

/* Add-on Header */
.dedication-addon-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--nf-navy, #2c3e50);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--nf-border-light, #e0e0e0);
}

/* Add-on CTA Button */
.dedication-addon-cta {
    margin-top: 12px;
    padding: 10px 16px;
    border: 1px solid var(--nf-navy, #2c3e50);
    border-radius: 6px;
    background: transparent;
    color: var(--nf-navy, #2c3e50);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dedication-addon-cta:hover {
    background: var(--nf-navy, #2c3e50);
    color: #fff;
}

/* Footer */
.dedication-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--nf-border-light, #e0e0e0);
    background: var(--nf-surface, #f8f9fa);
}

.dedication-btn-secondary {
    padding: 12px 24px;
    border: 1px solid var(--nf-border, #ccc);
    border-radius: 8px;
    background: transparent;
    color: var(--nf-muted, #666);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dedication-btn-secondary:hover {
    border-color: var(--nf-navy, #2c3e50);
    color: var(--nf-navy, #2c3e50);
}

.dedication-btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: var(--nf-navy, #2c3e50);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dedication-btn-primary:hover {
    background: #34495e;
}

/* Responsive */
@media (max-width: 600px) {
    .dedication-modal-content {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .dedication-field-row {
        grid-template-columns: 1fr;
    }
    
    .dedication-type-toggle {
        flex-direction: column;
    }
    
    .dedication-modal-footer {
        flex-direction: column-reverse;
    }
    
    .dedication-modal-footer button {
        width: 100%;
    }
}