/* ============================================================
   gifts.css — Thira Creations Gifts Page
   ============================================================ */

/* ── Gifts grid ── */
.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

/* ── Gift card ── */
.gift-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gift-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* ── Card image ── */
.gift-card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: var(--light-gray);
}

.gift-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gift-card:hover .gift-card-image img {
    transform: scale(1.05);
}

.gift-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: linear-gradient(135deg, var(--light-gray), var(--gray));
}

.gift-price-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--coral);
    color: var(--white);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ── Card body ── */
.gift-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

.gift-category-tag {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--coral);
}

.gift-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy-blue);
    margin: 0;
}

.gift-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.55;
    flex: 1;
}

.gift-card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray);
}

.gift-qty-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: space-between;
}

.gift-qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--coral);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.qty-btn {
    background: var(--coral);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.qty-btn:hover { background: var(--navy-blue); }

.qty-val {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--navy-blue);
    padding: 0 0.4rem;
    background: var(--white);
}

.gift-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy-blue);
}

.btn-order-gift {
    background: var(--coral);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background 0.2s, transform 0.15s;
    flex: 1;
}

.btn-order-gift:hover  { background: var(--navy-blue); }
.btn-order-gift:active { transform: scale(0.97); }

/* ══════════════════════════════════════════════
   ORDER MODAL
   ══════════════════════════════════════════════ */
.gift-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.gift-modal-overlay.open { display: flex; }

.gift-modal {
    background: var(--white);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gift-modal h2 {
    color: var(--navy-blue);
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.modal-price {
    color: var(--coral);
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.gift-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--coral);
    color: var(--white);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.gift-modal-close:hover { background: var(--navy-blue); }

/* ── Payment toggle ── */
.payment-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.payment-btn {
    flex: 1;
    padding: 0.7rem 0.5rem;
    border: 2px solid var(--gray);
    border-radius: 8px;
    background: var(--light-gray);
    color: var(--text-dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-btn.active {
    background: var(--coral);
    color: var(--white);
    border-color: var(--coral);
}

.payment-hint {
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* ── Form fields ── */
.gift-form-group {
    margin-bottom: 0.9rem;
}

.gift-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.gift-form-group input,
.gift-form-group textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--white);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.gift-form-group input:focus,
.gift-form-group textarea:focus {
    outline: none;
    border-color: var(--coral);
}

/* ── Stripe card element ── */
.stripe-card-element {
    padding: 0.75rem;
    border: 2px solid var(--gray);
    border-radius: 8px;
    background: var(--white);
    transition: border-color 0.2s;
}

.stripe-card-element.StripeElement--focus {
    border-color: var(--coral);
}

.stripe-error {
    color: #e8a687;
    font-size: 0.82rem;
    margin-top: 0.4rem;
    min-height: 1.2em;
}

/* ── Confirm button ── */
.btn-confirm-order {
    width: 100%;
    background: linear-gradient(135deg, var(--navy-blue), var(--light-navy));
    border: 2px solid var(--coral);
    color: var(--white);
    padding: 0.9rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.3s, color 0.3s;
}

.btn-confirm-order:hover    { background: var(--coral); color: var(--navy-blue); }
.btn-confirm-order:disabled { opacity: 0.6; cursor: not-allowed; }

.order-note {
    font-size: 0.75rem;
    color: #aaa;
    text-align: center;
    margin-top: 0.6rem;
    line-height: 1.4;
}

/* ── Toast ── */
.gift-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--dark-navy);
    color: var(--white);
    font-size: 0.85rem;
    padding: 0.7rem 1.5rem;
    border-radius: 100px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    max-width: 90vw;
    text-align: center;
}
.gift-toast.show          { opacity: 1; transform: translateX(-50%) translateY(0); }
.gift-toast.show.error    { background: #c82333; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .gifts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .gift-card-image { height: 200px; }
    .gift-card-body  { padding: 1rem; }
    .gift-name       { font-size: 1rem; }
}

@media (max-width: 480px) {
    .gifts-grid { grid-template-columns: 1fr; }
    .gift-card-image { height: 240px; }
    .payment-toggle { flex-direction: column; }
    .gift-modal { padding: 1.5rem; border-radius: 16px; }
}

/* ══════════════════════════════════════════════
   GIFT CARD IMAGE — clickable + badges
   ══════════════════════════════════════════════ */
.gift-card-image {
    cursor: pointer;
}

.gift-zoom-icon {
    position: absolute;
    bottom: 0.6rem;
    right: 0.6rem;
    background: rgba(0,0,0,0.45);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.gift-card:hover .gift-zoom-icon { opacity: 1; }

.gift-image-count {
    position: absolute;
    bottom: 0.6rem;
    left: 0.6rem;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    pointer-events: none;
}

/* ══════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════ */
.gift-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0,0,0,0.92);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.gift-lightbox.open { display: flex; }

.lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox-inner img {
    max-width: 80vw;
    max-height: 72vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    animation: lbIn 0.2s ease;
}

@keyframes lbIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.lightbox-caption {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    text-align: center;
}

.lightbox-counter {
    color: var(--light-coral);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--coral);
    color: var(--white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1;
}
.lightbox-close:hover { background: var(--light-coral); }

/* Prev / next */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(232,166,135,0.85);
    color: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 1;
}
.lightbox-nav:hover { background: var(--coral); transform: translateY(-50%) scale(1.1); }
.lightbox-nav.prev  { left: 1.25rem; }
.lightbox-nav.next  { right: 1.25rem; }

/* Dot navigation */
.lightbox-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.lb-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.lb-dot.active,
.lb-dot:hover { background: var(--coral); transform: scale(1.25); }

/* Mobile adjustments */
@media (max-width: 600px) {
    .lightbox-inner img {
        max-width: 94vw;
        max-height: 60vh;
    }
    .lightbox-nav { width: 38px; height: 38px; font-size: 1rem; }
    .lightbox-nav.prev { left: 0.5rem; }
    .lightbox-nav.next { right: 0.5rem; }
}