/* ============================================================
   Vidya Packtech — Box Calculator Stylesheet
   Compact & Mobile Optimized
   ============================================================ */

:root {
  --primary: #D63031;
  --primary-dark: #B71C1C;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #2D3436;
  --text-light: #636E72;
  --border: #e0e6ed;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.4; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; background: #DC4244 !important; padding: 0; height: 92px !important; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.header-container, .header-inner { display: flex !important; align-items: center !important; justify-content: space-between !important; width: 100%; max-width: 1440px !important; margin: 0 auto; position: relative; height: 92px !important; padding: 0 24px !important; gap: 15px !important; }
.header-logo, .brand-logo { display: flex !important; align-items: center !important; height: 72px !important; padding: 0 !important; box-sizing: border-box; flex-shrink: 0 !important; }
.header-logo img, .brand-logo img { height: 72px !important; max-height: 72px !important; width: auto !important; max-width: none !important; display: block !important; object-fit: contain !important; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12)); }
.header-nav, .main-nav { color: white; font-weight: 600; font-size: 0.92rem; display: flex !important; align-items: center !important; gap: 4px !important; position: static !important; transform: none !important; flex-wrap: nowrap !important; }
.nav-link { color: rgba(255, 255, 255, 0.92) !important; text-decoration: none; font-size: 0.92rem !important; font-weight: 600 !important; padding: 9px 13px !important; border-radius: 8px !important; transition: all 0.2s ease !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 7px !important; white-space: nowrap !important; line-height: 1 !important; }
.nav-link i, .nav-link svg { font-size: 1.05rem !important; width: 18px !important; text-align: center !important; display: inline-block !important; }
.nav-link:hover { color: white !important; background: rgba(255, 255, 255, 0.18) !important; transform: translateY(-1px); }
.nav-link.active { color: white !important; background: rgba(255, 255, 255, 0.25) !important; font-weight: 700 !important; box-shadow: inset 0 -2px 0 #FFFFFF; }
.header-contact { display: flex; gap: 1rem; }
.header-contact a { color: #fff; text-decoration: none; font-size: 0.8rem; display: flex; align-items: center; gap: 0.4rem; }
.header-contact svg { width: 16px; height: 16px; }

/* Hero Banner */
.hero-banner { max-width: 1200px; margin: 0.5rem auto; padding: 0 0.5rem; }
.hero-container { max-width: 1200px; margin: 0 auto; }
.hero-card { background: #DC4244; border-radius: 8px; padding: 0.8rem 1.2rem; color: white; display: flex; flex-direction: column; gap: 0.5rem; }
.hero-headline { font-size: 1.2rem; font-weight: 700; margin: 0; text-align: center; }
.hero-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.2rem; list-style: none; font-size: 0.8rem; }
.hero-feature { display: flex; align-items: center; gap: 0.4rem; }
.hero-tagline { display: none; }

/* Calculator Structure */
.calculator-container { max-width: 1200px; margin: 0 auto; padding: 0 0.5rem 1rem; }
.calculator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; align-items: start; }
.calculator-left, .calculator-right { display: flex; flex-direction: column; gap: 0.8rem; }

/* Sections */
.calc-section { background: var(--card); border-radius: 8px; padding: 0.8rem 1rem; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.04); margin: 0; }
.calc-section legend { display: flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 0.4rem; padding: 0; }
.section-description { font-size: 0.75rem; color: var(--text-light); margin-bottom: 0.5rem; }
.step-number { width: 20px; height: 20px; background: var(--primary); color: white; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; }

/* Inputs */
.size-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.input-group { display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.3rem;}
.input-group label { font-size: 0.75rem; font-weight: 600; color: #495057; }
.input-group input, .input-group select { height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; font-size: 0.85rem; outline: none; background: #fafbfc; width: 100%; transition: border 0.2s; }
.input-group input:focus, .input-group select:focus { border-color: var(--primary); background: #fff; }

/* Common Radio Cards */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; }
#section-board-grade .radio-cards { grid-template-columns: 1fr 1fr; }
.radio-card { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; background: #fafbfc; transition: all 0.2s; margin: 0; width: 100%;}
.radio-card:hover { border-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: #FFF5F5; }
.radio-card input[type="radio"] { margin-top: 2px; accent-color: var(--primary); cursor: pointer; }
.radio-card-content { display: flex; flex-direction: column; gap: 0.1rem; }
.radio-card-title { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.radio-card-desc { font-size: 0.7rem; color: var(--text-light); line-height: 1.2; }

/* Color Cards */
.color-options { display: flex; gap: 0.6rem; }
.color-card { flex: 1; padding: 0.6rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; text-align: center; background: #fafbfc; transition: all 0.2s; }
.color-card:hover { border-color: var(--primary); }
.color-card:has(input:checked) { border-color: var(--primary); background: #FFF5F5; }
.color-card input[type="radio"] { display: none; }
.color-swatch { width: 40px; height: 30px; border-radius: 4px; margin: 0 auto 0.4rem; border: 1px solid var(--border); }
.color-swatch.brown { background: linear-gradient(135deg, #8B6914, #8B4513); }
.color-swatch.white { background: #FFFFFF; }
.color-label { font-size: 0.8rem; font-weight: 600; }

/* Shapes Grid */
.shapes-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.shape-card { padding: 0.5rem 0.2rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; text-align: center; background: #fafbfc; transition: all 0.2s; }
.shape-card:hover { border-color: var(--primary); }
.shape-card:has(input:checked) { border-color: var(--primary); background: #FFF5F5; }
.shape-card input[type="radio"] { display: none; }
.shape-icon { font-size: 1.3rem; display: block; margin-bottom: 0.2rem; line-height: 1; }
.shape-label { font-size: 0.7rem; font-weight: 500; line-height: 1.1; display: block; }

/* Coating Grid */
.coating-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.checkbox-card { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 0.75rem; background: #fafbfc; transition: all 0.2s; }
.checkbox-card:hover { border-color: var(--primary); }
.checkbox-card:has(input:checked) { background: #FFF5F5; border-color: var(--primary); }
.checkbox-card input[type="checkbox"] { accent-color: var(--primary); cursor: pointer; margin: 0;}
.checkbox-label { font-weight: 500; }

/* Calculate Button */
.btn-calculate { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 6px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 0.5rem; transition: background 0.2s; box-shadow: 0 2px 8px rgba(214, 48, 49, 0.3); }
.btn-calculate:hover { background: var(--primary-dark); }

/* Pricing Section */
.pricing-section { background: #1a1a2e !important; color: white; border: none !important; }
.pricing-section legend { color: white !important; }
.pricing-section .step-number { background: #00B894; color: white; }
.pricing-card { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 1rem; border: 1px solid rgba(255,255,255,0.1); margin-bottom: 1rem; }
.pricing-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; }
.pricing-row:last-child { border-bottom: none; }
.pricing-row span:first-child { color: rgba(255,255,255,0.7); }
.pricing-row span:last-child { font-weight: 600; color: white; }
.pricing-row.total { padding-top: 0.6rem; margin-top: 0.2rem; border-top: 1px solid rgba(255,255,255,0.2); border-bottom: none; }
.pricing-row.total span:first-child { font-weight: 700; color: white; font-size: 0.95rem; }
.pricing-row.total span:last-child { color: #00B894; font-size: 1.1rem; }

/* Actions */
.action-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.action-buttons button { padding: 10px 5px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; border: none; color: white; transition: opacity 0.2s; }
.action-buttons button:hover { opacity: 0.9; }
.btn-whatsapp { background: #25D366; }
.btn-email { background: #0984E3; }
.btn-pdf { background: var(--primary); }

/* Footer */
.site-footer { background: #1a1a2e; color: white; text-align: center; padding: 1rem; font-size: 0.8rem; }
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-brand h3 { margin: 0; font-size: 1rem; }
.footer-tagline { color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; font-size: 0.75rem; }
.footer-links { display: flex; justify-content: center; gap: 1rem; margin-bottom: 0.5rem; }
.footer-links a { color: #fff; text-decoration: none; }
.footer-copyright { color: rgba(255,255,255,0.4); font-size: 0.7rem; }

/* Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(3px); }
.modal-content { background: white; border-radius: 8px; padding: 1.5rem; width: 100%; max-width: 400px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.modal-close { position: absolute; top: 10px; right: 10px; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #666; }
.modal-content h2 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text); }
.modal-content p { font-size: 0.8rem; color: var(--text-light); margin-bottom: 1rem; }
.modal-form { display: flex; flex-direction: column; gap: 0.8rem; }
.modal-form label { font-size: 0.8rem; font-weight: 600; }
.modal-form input { height: 38px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; font-family: inherit; }
.modal-form button { padding: 12px; border-radius: 6px; border: none; color: white; font-weight: bold; cursor: pointer; font-size: 0.9rem; }
.email-status { font-size: 0.8rem; padding: 0.5rem; text-align: center; margin-top: 0.5rem; border-radius: 4px; }
.email-status.success { background: #D4EDDA; color: #155724; }

/* Responsive Options */
@media (max-width: 900px) {
    .calculator-grid { grid-template-columns: 1fr; }
    .calculator-left, .calculator-right { gap: 0.6rem; }
}

@media (max-width: 600px) {
    .header-contact span { display: none; }
    .hero-features { display: none; }
    .hero-card { padding: 0.6rem; }
    .hero-headline { font-size: 1rem; }
    .calc-section { padding: 0.6rem; }
    .shapes-grid { grid-template-columns: repeat(3, 1fr); gap: 0.3rem; }
    .coating-grid { grid-template-columns: repeat(2, 1fr); gap: 0.3rem; }
    #section-board-grade .radio-cards { grid-template-columns: 1fr; gap: 0.3rem; }
    .size-inputs { grid-template-columns: 1fr; gap: 0.4rem; }
    .action-buttons { grid-template-columns: 1fr; gap: 0.4rem; }
    .page-title { font-size: 1.5rem; }
    .page-subtitle { font-size: 0.9rem; margin-bottom: 1rem; }
}

/* ──────────────────────────────────────────────────────────────
   PWA & NATIVE MOBILE APP STYLES
   ────────────────────────────────────────────────────────────── */

.btn-pwa-install {
    display: none;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    color: var(--primary);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.btn-pwa-install:hover {
    transform: scale(1.04);
    background: #f8fafc;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #e2e8f0;
    z-index: 999;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
    }
    body.has-mobile-nav {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0)) !important;
    }
    .header-nav {
        display: none !important; /* Replaced by bottom nav on mobile */
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: #64748b;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 0;
}

.bottom-nav-item i {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    transform: translateY(-2px);
}

.bottom-nav-item.install-btn {
    color: #0284c7;
}

.bottom-nav-item.install-btn.pulse-active {
    animation: pwaPulse 2s infinite;
}

@keyframes pwaPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); color: var(--primary); }
}

/* PWA Modals */
.pwa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 3000;
    animation: fadeIn 0.2s ease;
}

.pwa-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 360px;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.pwa-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.pwa-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.pwa-step-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.8rem;
    text-align: left;
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pwa-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.35;
}

.pwa-step-num {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-modal-close-btn {
    width: 100%;
    height: 42px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.pwa-modal-close-btn:hover {
    background: #b82f31;
}
