/*
 * multi-gift.css — mg- prefix
 * Multi-Address Gifting / Corporate Gifting checkout enhancement
 */

/* ── Toggle section ───────────────────────────────────────── */
.mg-toggle-section {
    background: #FAFAF8;
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.mg-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* Switch track */
.mg-toggle-switch-wrap {
    flex-shrink: 0;
    position: relative;
    width: 44px;
    height: 24px;
}
.mg-toggle-switch-wrap input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.mg-toggle-switch {
    position: absolute;
    inset: 0;
    background: #D8D3CB;
    border-radius: 99px;
    transition: background 0.25s ease;
    cursor: pointer;
}
.mg-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    transition: transform 0.25s ease;
}
.mg-toggle-switch-wrap input:checked + .mg-toggle-switch {
    background: #1A1A1A;
}
.mg-toggle-switch-wrap input:checked + .mg-toggle-switch::after {
    transform: translateX(20px);
}
.mg-toggle-switch-wrap input:focus-visible + .mg-toggle-switch {
    outline: 2px solid #C9A96E;
    outline-offset: 2px;
}

.mg-toggle-text strong {
    display: block;
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    font-size: 0.88rem;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.3;
}
.mg-toggle-sub {
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    font-size: 0.72rem;
    color: #999;
    font-style: normal;
    margin-top: 0.1rem;
    display: block;
}

/* ── Per-item panel ───────────────────────────────────────── */
.mg-items-panel {
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background: #fff;
    animation: mgFadeIn 0.2s ease;
}

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

.mg-panel-hint {
    font-size: 0.75rem;
    color: #999;
    margin: 0 0 1.1rem;
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
}

/* ── Single item row ──────────────────────────────────────── */
.mg-item-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #F0EBE3;
}
.mg-item-row:last-of-type { border-bottom: none; }

.mg-item-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 7px;
    background: #faf7f2;
    flex-shrink: 0;
    align-self: start;
}

.mg-item-meta {
    padding-top: 0.1rem;
}
.mg-item-name {
    font-family: var(--serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.92rem;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0 0 0.15rem;
    line-height: 1.3;
}
.mg-item-qty {
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    font-size: 0.7rem;
    color: #999;
    margin: 0 0 0.65rem;
}

/* ── Item controls (address select + message) ─────────────── */
.mg-item-controls {
    grid-column: 1 / -1;
    padding-left: 0;
}

@media (min-width: 640px) {
    .mg-item-row {
        grid-template-columns: 52px 1fr;
    }
    .mg-item-controls {
        grid-column: 2;
        padding-left: 0;
    }
}

.mg-addr-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #D8D3CB;
    border-radius: 7px;
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    font-size: 0.8rem;
    color: #1A1A1A;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    transition: border-color 0.2s;
    cursor: pointer;
}
.mg-addr-select:focus {
    outline: none;
    border-color: #1A1A1A;
    box-shadow: 0 0 0 2px rgba(26,26,26,0.06);
}

/* ── Missing address warning ──────────────────────────────── */
.mg-missing-warning {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    color: #B45309;
    font-weight: 600;
}
.mg-missing-warning i { font-size: 0.75rem; }

/* ── Gift message textarea ────────────────────────────────── */
.mg-msg-textarea {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #E5E5E5;
    border-radius: 7px;
    font-family: var(--serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.85rem;
    color: #1A1A1A;
    resize: vertical;
    min-height: 56px;
    line-height: 1.5;
    transition: border-color 0.2s;
    background: #FAFAF8;
}
.mg-msg-textarea::placeholder {
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    font-size: 0.75rem;
    color: #C0BAB0;
    font-style: italic;
}
.mg-msg-textarea:focus {
    outline: none;
    border-color: #C9A96E;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(201,169,110,0.1);
}

.mg-char-count {
    display: block;
    text-align: right;
    font-size: 0.65rem;
    color: #C0BAB0;
    margin-top: 0.2rem;
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
}

/* ── Add address link ─────────────────────────────────────── */
.mg-add-addr-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #C9A96E;
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}
.mg-add-addr-link:hover { color: #b8935a; }
.mg-add-addr-link i { font-size: 0.8rem; }

/* ── Order-level warning (place-order area) ───────────────── */
.mg-order-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    font-family: var(--sans, 'Outfit', system-ui, sans-serif);
    font-size: 0.78rem;
    font-weight: 600;
    color: #92400E;
    margin-bottom: 0.9rem;
}
.mg-order-warning i { font-size: 0.9rem; color: #D97706; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 639px) {
    .mg-item-controls { grid-column: 1 / -1; margin-top: 0.5rem; }
    .mg-item-row      { grid-template-columns: 52px 1fr; }
}

@media (max-width: 480px) {
    .mg-toggle-section { padding: 0.85rem 1rem; }
    .mg-items-panel    { padding: 1rem; }
}
