/*
 * AMIRA Jewelers - Mobile-First Stylesheet
 * Premium Gold Jewelry E-Commerce
 * Optimized for Mobile Devices (70%+ traffic)
 */

/* ===================================
   1. CSS VARIABLES & ROOT STYLES
   =================================== */
:root {
    /* Brand Colors */
    --gold: #D4AF37;
    --gold-light: #F4E4BC;
    --gold-dark: #B8860B;
    --gold-darker: #8B6914;
    --black: #1a1a1a;
    --white: #ffffff;
    --gray-light: #fafafa;
    --gray-medium: #e0e0e0;
    --gray-dark: #666;
    
    /* Status Colors */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Spacing (Mobile-First) */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-round: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-gold: 0 5px 20px rgba(212, 175, 55, 0.3);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index Layers */
    --z-sticky: 100;
    --z-modal: 1000;
    --z-toast: 2000;
    --z-tooltip: 3000;
}

/* ===================================
   2. MOBILE-FIRST BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; /* Base font size */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--gray-light);
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 1.75rem; } /* 28px on mobile */
h2 { font-size: 1.5rem; }  /* 24px */
h3 { font-size: 1.25rem; } /* 20px */
h4 { font-size: 1.125rem; } /* 18px */
h5 { font-size: 1rem; }    /* 16px */
h6 { font-size: 0.875rem; } /* 14px */

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===================================
   3. NAVIGATION - MOBILE FIRST
   =================================== */
.navbar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: var(--spacing-sm) 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem; /* Smaller on mobile */
    color: var(--gold) !important;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.navbar-brand img {
    height: 40px; /* Mobile-optimized size */
    object-fit: contain;
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md) !important;
    transition: all var(--transition-normal);
    /* Mobile: Larger tap target (min 44x44px) */
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--gold) !important;
    background-color: rgba(212, 175, 55, 0.1);
    border-radius: var(--radius-sm);
}

/* Mobile Menu (Hamburger) */
.navbar-toggler {
    border: none;
    padding: var(--spacing-xs);
    /* Mobile: Larger tap target */
    min-width: 44px;
    min-height: 44px;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: 2px solid var(--gold);
}

.navbar-collapse {
    background: #1a1a1a;
    padding: var(--spacing-lg);
    margin-top: var(--spacing-md);
    border-radius: var(--radius-md);
    max-height: 70vh;
    overflow-y: auto;
}

/* ===================================
   4. BUTTONS - MOBILE OPTIMIZED
   =================================== */
.btn {
    font-weight: 600;
    padding: 12px 24px; /* Mobile: Larger for easier tapping */
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    /* Mobile: Min tap target */
    min-height: 44px;
    font-size: 0.95rem;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--black);
}

.btn-gold:hover,
.btn-gold:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
    color: var(--black);
}

.btn-outline-gold {
    border: 2px solid var(--gold);
    color: var(--gold);
    background: transparent;
}

.btn-outline-gold:hover,
.btn-outline-gold:active {
    background: var(--gold);
    color: var(--black);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ===================================
   5. GOLD PRICE TICKER
   =================================== */
.gold-ticker {
    background: linear-gradient(90deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    padding: var(--spacing-sm) 0;
    border-bottom: 2px solid var(--gold);
    overflow: hidden;
}

.ticker-content {
    display: flex;
    animation: scroll-left 30s linear infinite;
    gap: var(--spacing-xxl);
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
    color: var(--white);
    font-weight: 600;
    min-width: max-content;
    font-size: 0.9rem; /* Mobile */
}

.ticker-item i {
    color: var(--gold);
    font-size: 1rem;
}

.ticker-karat {
    color: var(--gold);
    font-weight: 700;
}

.ticker-price {
    color: var(--white);
}

.ticker-price.up {
    color: var(--success);
}

.ticker-price.down {
    color: var(--danger);
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.ticker-item::after {
    content: '•';
    margin-left: var(--spacing-xxl);
    color: var(--gold);
    font-size: 1.2rem;
}

.ticker-item:last-child::after {
    content: '';
}

/* ===================================
   6. FOOTER - MOBILE FIRST
   =================================== */
.footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    color: var(--white);
    padding: var(--spacing-xxl) 0 var(--spacing-lg);
    margin-top: var(--spacing-xxl);
}

.footer h5 {
    color: var(--gold);
    margin-bottom: var(--spacing-lg);
    font-size: 1.125rem;
}

.footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color var(--transition-normal);
    display: block;
    padding: var(--spacing-xs) 0;
}

.footer a:hover {
    color: var(--gold);
}

.social-icons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; /* Mobile tap target */
    height: 44px;
    border-radius: var(--radius-round);
    background: rgba(255,255,255,0.1);
    color: var(--white);
    transition: all var(--transition-normal);
    padding: 0;
}

.social-icons a:hover {
    background: var(--gold);
    color: var(--black);
    transform: translateY(-3px);
}

/* ===================================
   7. WHATSAPP FLOATING BUTTON (Mobile Priority)
   =================================== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--z-modal);
    animation: pulse 2s infinite;
}

.whatsapp-float a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: var(--radius-round);
    box-shadow: var(--shadow-lg);
    color: var(--white);
    font-size: 2rem;
    transition: all var(--transition-normal);
}

.whatsapp-float a:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(37, 211, 102, 0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===================================
   8. REVIEW POPUP - MOBILE
   =================================== */
.review-popup {
    position: fixed;
    bottom: 100px;
    left: var(--spacing-md);
    right: var(--spacing-md); /* Mobile: Full width with margins */
    max-width: 340px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-lg);
    z-index: var(--z-modal);
    animation: slideIn 0.5s ease;
    display: none;
}

.review-popup.show {
    display: block;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.review-popup .close-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-dark);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-popup .stars {
    color: var(--gold);
}

/* ===================================
   9. ALERT MESSAGES
   =================================== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ===================================
   10. CARDS & PRODUCTS - MOBILE
   =================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: none;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-img-top {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-card {
    position: relative;
}

.product-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: var(--gold);
    color: var(--black);
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold-dark);
}

.product-price-old {
    text-decoration: line-through;
    color: var(--gray-dark);
    font-size: 1rem;
    margin-left: var(--spacing-xs);
}

/* ===================================
   11. FORMS - MOBILE OPTIMIZED
   =================================== */
.form-control,
.form-select {
    padding: 12px var(--spacing-md);
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-sm);
    font-size: 1rem; /* Prevent zoom on iOS */
    transition: border-color var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-label {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--black);
}

/* ===================================
   12. UTILITY CLASSES
   =================================== */
.text-gold { color: var(--gold) !important; }
.bg-gold { background-color: var(--gold) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-3 { margin-top: var(--spacing-lg) !important; }
.mb-3 { margin-bottom: var(--spacing-lg) !important; }
.p-3 { padding: var(--spacing-lg) !important; }

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

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

/* ===================================
   14. TABLET BREAKPOINT (768px+)
   =================================== */
@media (min-width: 768px) {
    /* Typography - Larger */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    /* Navbar */
    .navbar-brand { font-size: 1.5rem; }
    .navbar-brand img { height: 50px; }
    .navbar-collapse {
        background: transparent;
        padding: 0;
        margin-top: 0;
    }
    
    /* Ticker */
    .ticker-item { font-size: 1rem; }
    
    /* Review Popup */
    .review-popup {
        left: var(--spacing-lg);
        right: auto;
    }
    
    /* WhatsApp Float */
    .whatsapp-float {
        bottom: 30px;
        right: 30px;
    }
}

/* ===================================
   15. DESKTOP BREAKPOINT (1024px+)
   =================================== */
@media (min-width: 1024px) {
    /* Container max-width */
    .container {
        max-width: 1200px;
    }
    
    /* Typography */
    h1 { font-size: 3rem; }
    
    /* Buttons */
    .btn { padding: 12px 32px; }
    
    /* Hover effects (desktop only) */
    .card-img-top {
        transition: transform var(--transition-slow);
    }
    
    .card:hover .card-img-top {
        transform: scale(1.05);
    }
}

/* ===================================
   16. ACCESSIBILITY
   =================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   17. PRINT STYLES
   =================================== */
@media print {
    .navbar,
    .footer,
    .whatsapp-float,
    .review-popup,
    .gold-ticker {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
