/* CONTENT FOR: DollsDollhouse/css/modal.css */

/* BASE MODAL STRUCTURE */
.modal {
    display: none; 
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px; /* Default small size */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

.modal-content.large-modal {
    max-width: 800px;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* CLOSE BUTTON */
.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close-modal:hover,
.close-modal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* FORM ELEMENTS INSIDE MODAL */
.modal-content h2 {
    margin-top: 0;
    color: #db2777;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-content input, 
.modal-content select, 
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

/* Generic Button Styles */
.modal-content button {
    width: 100%;
    background-color: #db2777;
    color: white;
    padding: 12px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.modal-content button:hover {
    background-color: #be185d;
}

.modal-content button.secondary-btn {
    background-color: #f3f4f6;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

.modal-content button.secondary-btn:hover {
    background-color: #e5e7eb;
}

/* GRID HELPERS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* =========================================
   VARIANT ROWS & OVERRIDES (FIXES LAYOUT)
   ========================================= */

/* 1. Reset the Row Container */
.variant-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #eee;
    padding: 8px;
    border-radius: 8px;
}

/* 2. Fix Inputs inside Variant Row 
   (Must use specificity to override the .modal-content input width: 100%) */
.modal-content .variant-row input {
    width: auto !important; /* Stop taking full width */
    margin: 0;              /* Remove default margin */
    padding: 8px;           /* Reduce padding for tighter fit */
    font-size: 0.9rem;
}

/* 3. Fix the "Huge X" Delete Button */
.modal-content .variant-row .delete-icon {
    width: 32px !important;  /* Fixed small width */
    height: 32px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #ef4444;
    font-size: 1.2rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.modal-content .variant-row .delete-icon:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* 4. Variant Header Styling */
.variant-header-row {
    display: flex;
    gap: 8px;
    padding: 0 8px 5px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 5. Mini Upload Button Fix */
.mini-upload {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.mini-upload-btn {
    display: inline-block;
    padding: 6px 10px;
    font-size: 0.8rem;
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fce7f3;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.mini-upload-btn:hover {
    background: #db2777;
    color: white;
}

.mini-preview {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #ddd;
}

/* YOCO INLINE STYLING */
#card-frame {
    border: 1px solid #e5e7eb; /* Light grey default */
    border-radius: 8px;
    padding: 5px; /* Padding around iframe */
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

#card-frame:hover {
    border-color: #fce7f3; /* Light pink on hover */
    background-color: #fff;
}

.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 11000;
    justify-content: center;
    align-items: flex-start; /* Aligns to top for scrolling */
    padding-top: 40px;
    overflow-y: auto;
    backdrop-filter: blur(8px); /* Luxury Glass Effect */
    animation: fadeIn 0.3s ease-out;
}

.chk-container {
    background: #fff;
    width: 95%;
    max-width: 1000px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 50px;
    font-family: 'Inter', sans-serif;
    animation: slideUp 0.4s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* HEADER */
.chk-header {
    background: linear-gradient(135deg, #fdf2f8 0%, #fff 100%);
    padding: 30px 40px;
    border-bottom: 1px solid #fce7f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chk-header h2 {
    margin: 0;
    font-family: 'Lovelace', serif; /* Brand Font */
    color: #db2777;
    font-size: 2rem;
    font-weight: 500;
}

.chk-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #db2777;
    cursor: pointer;
    transition: transform 0.3s ease;
    opacity: 0.7;
}
.chk-close:hover { transform: rotate(90deg); opacity: 1; }

/* LAYOUT GRID */
.chk-body { display: grid; grid-template-columns: 1.3fr 0.7fr; }
.chk-main { padding: 40px; border-right: 1px solid #f3f4f6; }
.chk-sidebar { background: #fafafa; padding: 40px; display: flex; flex-direction: column; }

/* SECTIONS */
.chk-section { margin-bottom: 40px; }
.chk-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.chk-section-title::after { content:''; flex:1; height:1px; background:#e5e7eb; }

/* FORMS */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: #374151; margin-bottom: 8px; }

.pp-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #fff;
    color: #1f2937;
}
.pp-input:focus {
    border-color: #db2777;
    outline: none;
    box-shadow: 0 0 0 4px rgba(219, 39, 119, 0.1);
}
textarea.pp-input { resize: vertical; min-height: 100px; }

/* RADIO CARDS (Selection UI) */
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; cursor: pointer; }

.radio-card-content {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    justify-content: center;
    background: #fff;
}

.radio-card input:checked + .radio-card-content {
    border-color: #db2777;
    background: #fdf2f8;
    color: #db2777;
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.15);
}

.radio-icon { font-size: 2rem; margin-bottom: 10px; }
.radio-title { font-weight: 700; font-size: 1rem; }
.radio-desc { font-size: 0.85rem; color: #6b7280; margin-top: 5px; }
.radio-card input:checked + .radio-card-content .radio-desc { color: #db2777; }

/* SIDEBAR & SUMMARY */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #374151;
    padding-bottom: 15px;
    border-bottom: 1px dashed #f3f4f6;
}
.summary-item:last-child { border-bottom: none; }

.summary-total { margin-top: auto; padding-top: 25px; border-top: 2px dashed #e5e7eb; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total-label { font-size: 0.95rem; color: #6b7280; }
.total-value { font-weight: 600; color: #111; }
.final-total { font-size: 1.8rem; color: #db2777; font-family: 'Lovelace', serif; }

.coupon-box { display: flex; gap: 10px; margin: 25px 0; }
.apply-btn {
    background: #1f2937;
    color: white;
    border: none;
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.apply-btn:hover { background: #000; }

.pay-btn {
    width: 100%;
    padding: 20px;
    background: #db2777;
    background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(219, 39, 119, 0.3);
    margin-top: 25px;
}
.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(219, 39, 119, 0.4);
}
.pay-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* RESPONSIVE */
@media(max-width: 900px) {
    .chk-body { grid-template-columns: 1fr; }
    .chk-main { border-right: none; padding: 25px; }
    .chk-sidebar { padding: 25px; border-top: 1px solid #f3f4f6; order: -1; }
    .radio-group { grid-template-columns: 1fr; }
}