/**
 * 2026 PrestaShop Module: GiftProducts Front CSS
 */

.giftproducts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9999999 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    animation: giftFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes giftFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.giftproducts-modal-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.giftproducts-modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.giftproducts-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.giftproducts-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.giftproducts-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.giftproducts-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.giftproducts-subtitle {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 20px;
}

.giftproducts-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.giftproduct-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.giftproduct-card--selected {
    border-color: #10b981;
    background: #f0fdf4;
}

.giftproduct-card:hover {
    border-color: #6366f1;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.25);
    background: #ffffff;
}

.giftproduct-card--selected:hover {
    border-color: #059669;
    background: #ecfdf5;
}

.giftproduct-badge-free {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.giftproduct-badge-selected {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #059669;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.giftproduct-card-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 12px;
}

.giftproduct-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.giftproduct-card-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 12px;
}

.giftproduct-card-price s {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-right: 6px;
    font-weight: 400;
}

.giftproduct-select-btn {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    padding: 9px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-top: auto;
}

.giftproduct-select-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: scale(1.02);
}

.giftproduct-select-btn--selected {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.giftproduct-select-btn--selected:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

.giftproducts-modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

/* ─── Gift card image placeholder ─────────────────────────────────────────── */
.giftproduct-card-image-placeholder {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #e0e7ff, #f0f4ff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* ─── Toast notification ───────────────────────────────────────────────────── */
.giftproducts-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    background: #1e293b;
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    max-width: 380px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.giftproducts-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.giftproducts-toast--success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.giftproducts-toast--error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .giftproducts-modal-container {
        border-radius: 12px;
        max-height: 95vh;
    }

    .giftproducts-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .giftproducts-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

/* ─── Product Page Promo Badge ────────────────────────────────────────────── */
.giftproduct-product-badge {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* ─── In-Page Gift Selector Widget ───────────────────────────────────────── */
.giftproducts-inpage-container {
    background: linear-gradient(135deg, #fdf4ff 0%, #f0fdf4 100%);
    border: 2px solid #d1fae5;
    border-radius: 14px;
    padding: 18px;
    margin: 20px 0;
    font-family: inherit;
}

.giftproducts-inpage-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 6px;
}

.giftproducts-inpage-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 14px;
}

.giftproducts-inpage-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.giftproduct-inpage-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.giftproduct-inpage-card:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.giftproduct-inpage-card--active {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.giftproduct-inpage-card input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #10b981;
    flex-shrink: 0;
    cursor: pointer;
}

.giftproduct-inpage-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.giftproduct-inpage-img-placeholder {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: #f3f4f6;
    border-radius: 6px;
    flex-shrink: 0;
}

.giftproduct-inpage-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.giftproduct-inpage-badge {
    display: inline-block;
    background: #10b981;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.giftproduct-inpage-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

/* ─── Combination / Size selector inside gift card ─────────────────────────── */
.giftproduct-comb-wrapper {
    width: 100%;
    margin: 10px 0 8px;
    text-align: left;
}

.giftproduct-comb-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}

.giftproduct-comb-select {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: auto;
}

.giftproduct-comb-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.giftproduct-comb-select.error,
.giftproduct-comb-select[style*="border-color: rgb(239, 68, 68)"],
.giftproduct-comb-select[style*="borderColor"] {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.giftproduct-comb-error {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: #ef4444;
    font-weight: 600;
}
