/**
 * LTD.DO Frontend - Public Portal Styles
 * Mobile-first, PWA optimized
 */

/* ─────────────────────────────────────────────
   BOTTOM NAV (Mobile)
   ───────────────────────────────────────────── */
.frontend-bottom-nav {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
}

.frontend-bottom-nav a {
    min-width: 64px;
    transition: color 0.15s ease;
}

.frontend-bottom-nav a:active {
    transform: scale(0.95);
}

/* ─────────────────────────────────────────────
   PRODUCT CARDS
   ───────────────────────────────────────────── */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.product-card img {
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* ─────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────── */
.hero-gradient {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #6366F1 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: heroPattern 30s linear infinite;
}

@keyframes heroPattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* ─────────────────────────────────────────────
   CATEGORY CARDS
   ───────────────────────────────────────────── */
.category-card {
    transition: all 0.2s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: #4F46E5;
}

.category-card:hover .category-icon {
    background-color: #4F46E5;
    color: #fff;
}

.category-icon {
    transition: all 0.2s ease;
}

/* ─────────────────────────────────────────────
   FILTER PANEL (Catalog)
   ───────────────────────────────────────────── */
.filter-panel {
    transition: all 0.3s ease;
}

@media (max-width: 767px) {
    .filter-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 60;
        max-height: 80vh;
        border-radius: 24px 24px 0 0;
        overflow-y: auto;
        transform: translateY(100%);
    }

    .filter-panel.active {
        transform: translateY(0);
    }

    .filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 55;
    }
}

/* ─────────────────────────────────────────────
   BADGE / STATUS TAGS
   ───────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1.5;
}

.status-badge.pending { background: #FEF3C7; color: #92400E; }
.status-badge.sent { background: #DBEAFE; color: #1E40AF; }
.status-badge.viewed { background: #E0E7FF; color: #3730A3; }
.status-badge.approved { background: #D1FAE5; color: #065F46; }
.status-badge.rejected { background: #FEE2E2; color: #991B1B; }
.status-badge.expired { background: #F3F4F6; color: #6B7280; }
.status-badge.processing { background: #FEF3C7; color: #92400E; }
.status-badge.shipped { background: #DBEAFE; color: #1E40AF; }
.status-badge.delivered { background: #D1FAE5; color: #065F46; }
.status-badge.cancelled { background: #FEE2E2; color: #991B1B; }
.status-badge.active { background: #D1FAE5; color: #065F46; }

/* ─────────────────────────────────────────────
   ORDER PROGRESS STEPPER
   ───────────────────────────────────────────── */
.order-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
}

.order-stepper::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 32px;
    right: 32px;
    height: 2px;
    background: #E5E7EB;
    z-index: 0;
}

.order-stepper .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 100px;
}

.order-stepper .step .step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: #E5E7EB;
    color: #9CA3AF;
    transition: all 0.3s ease;
}

.order-stepper .step.completed .step-circle {
    background: #4F46E5;
    color: #fff;
}

.order-stepper .step.active .step-circle {
    background: #4F46E5;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.order-stepper .step .step-label {
    margin-top: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    color: #9CA3AF;
    text-align: center;
    line-height: 1.3;
}

.order-stepper .step.completed .step-label,
.order-stepper .step.active .step-label {
    color: #4F46E5;
}

/* ─────────────────────────────────────────────
   IMAGE GALLERY (Product Detail)
   ───────────────────────────────────────────── */
.gallery-main {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
}

.gallery-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s ease;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: #4F46E5;
}

/* ─────────────────────────────────────────────
   QUANTITY INPUT
   ───────────────────────────────────────────── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ─────────────────────────────────────────────
   AUTH PAGES (Login/Register)
   ───────────────────────────────────────────── */
.auth-gradient {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #F5F3FF 100%);
    min-height: 100vh;
}

/* ─────────────────────────────────────────────
   LOADING / SKELETON
   ───────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 340px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid #10B981;
}

.toast.error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid #EF4444;
}

.toast.info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid #3B82F6;
}

/* ─────────────────────────────────────────────
   SCROLL FIXES
   ───────────────────────────────────────────── */
/* Prevent body scroll when mobile menu or modal is open */
body.menu-open,
body.overflow-hidden {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Safe area padding for mobile */
.safe-bottom {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.safe-area-top {
    padding-top: env(safe-area-inset-top, 0px);
}

@media (min-width: 768px) {
    .safe-bottom {
        padding-bottom: 0;
    }
    body.overflow-hidden {
        position: static;
    }
}

/* ─────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease forwards;
}

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

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.animate-slideUp {
    animation: slideUp 0.3s ease forwards;
}

/* ─────────────────────────────────────────────
   RESPONSIVE SPACER (Mobile bottom nav)
   ───────────────────────────────────────────── */
.mobile-spacer {
    height: 0;
}

@media (max-width: 767px) {
    .mobile-spacer {
        height: 80px;
    }
}

/* ─────────────────────────────────────────────
   INTL-TEL-INPUT MODAL OVERRIDES
   ───────────────────────────────────────────── */
.iti {
    width: 100% !important;
}
.iti__tel-input {
    width: 100% !important;
    padding-top: 0.875rem !important;
    padding-bottom: 0.875rem !important;
    font-size: 1rem !important;
    border-radius: 0.75rem !important;
    border: 1px solid #d1d5db !important;
}
.iti__tel-input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}
.iti__country-container {
    border-radius: 0.75rem 0 0 0.75rem !important;
}
.iti__dropdown-content {
    z-index: 99999 !important;
}

/* ─────────────────────────────────────────────
   PRINT
   ───────────────────────────────────────────── */
@media print {
    .frontend-bottom-nav,
    nav.sticky,
    footer,
    #frontend-install-banner,
    #pwa-offline-banner,
    .toast {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }
}
