/* ============================================
   Ecom - Main Stylesheet
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg: #f9fafb;
    --white: #ffffff;
    --red: #ef4444;
    --yellow-bg: #fefce8;
    --yellow-border: #fde68a;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }

/* ---- Layout ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ---- Ads ---- */
.ad-wrap { width: 100%; text-align: center; overflow: hidden; }
.ad-top { margin-bottom: 0; }
.ad-bottom { margin-top: 0; }
.ad-container { display: inline-block; max-width: 100%; }

@media (max-width: 768px) { .desktop-only { display: none !important; } }
@media (min-width: 769px) { .mobile-only { display: none !important; } }

/* ---- Header ---- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 20px;
}
.site-logo { text-decoration: none; }
.logo-text { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.logo-img { height: 40px; width: auto; object-fit: contain; }

.main-nav ul { display: flex; list-style: none; gap: 4px; }
.main-nav a { text-decoration: none; color: var(--text); font-size: 0.95rem; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: background 0.2s, color 0.2s; }
.main-nav a:hover { background: var(--bg); color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 12px; }
.cart-icon { position: relative; text-decoration: none; color: var(--text); display: flex; align-items: center; padding: 6px; }
.cart-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--primary); color: white;
    font-size: 0.7rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

@media (max-width: 900px) {
    .hamburger { display: flex; }
    .main-nav {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        background: white; border-bottom: 1px solid var(--border);
        padding: 16px 20px; box-shadow: var(--shadow-md);
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .main-nav a { display: block; }
}

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #4f46e5 100%);
    color: white; text-align: center;
    padding: 80px 20px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; margin-bottom: 16px; }
.hero p { font-size: 1.1rem; opacity: 0.85; margin-bottom: 32px; max-width: 500px; margin-left: auto; margin-right: auto; }
.btn-hero { background: white; color: var(--primary); padding: 14px 36px; border-radius: 50px; font-weight: 700; text-decoration: none; font-size: 1rem; transition: transform 0.2s, box-shadow 0.2s; display: inline-block; }
.btn-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---- Products Section ---- */
.products-section { padding: 60px 0; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; text-align: center; margin-bottom: 40px; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-img-wrap { aspect-ratio: 1/1; overflow: hidden; background: #f3f4f6; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.product-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 3rem; }

.product-info { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.product-name { font-size: 0.95rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.product-price::before { content: '₹'; }
.btn-view {
    display: block; background: var(--primary); color: white;
    text-align: center; padding: 12px; border-radius: 8px;
    text-decoration: none; font-weight: 600; font-size: 0.95rem;
    transition: background 0.2s; margin-top: auto;
}
.btn-view:hover { background: var(--primary-dark); }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 40px 0 20px; flex-wrap: wrap; }
.page-btn {
    display: flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 8px;
    text-decoration: none; color: var(--text); font-size: 0.9rem; font-weight: 500;
    background: white; transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ---- Product Detail ---- */
.product-detail { padding: 60px 0; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
@media (max-width: 768px) { .product-detail-grid { grid-template-columns: 1fr; gap: 30px; } }

.product-detail-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 1/1; }
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info { display: flex; flex-direction: column; gap: 20px; }
.product-detail-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; }
.product-detail-price { font-size: 1.8rem; font-weight: 700; }
.product-detail-price::before { content: '₹'; }
.product-category-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary); color: white;
    padding: 6px 14px; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
}
.product-desc { color: var(--text-light); line-height: 1.8; }
.btn-buy {
    background: var(--primary); color: white; border: none;
    padding: 16px 40px; border-radius: 10px; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: background 0.2s, transform 0.2s;
    text-decoration: none; display: inline-block; text-align: center;
}
.btn-buy:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-buy:active { transform: translateY(0); }

/* ---- Cart ---- */
.cart-page { padding: 60px 0; }
.cart-box { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; max-width: 800px; margin: 0 auto; }
.cart-page h1 { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 32px; }
.cart-item { display: flex; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.cart-item-img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; }
.cart-item-id { font-size: 0.8rem; color: var(--text-light); margin-top: 2px; }
.cart-item-price { font-size: 1.1rem; font-weight: 700; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 28px; height: 28px; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.qty-btn:hover { background: var(--bg); }
.qty-num { min-width: 24px; text-align: center; font-weight: 600; }

.cart-totals { padding: 20px 0; border-top: 2px solid var(--border); }
.cart-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.95rem; }
.cart-row.total { font-size: 1.1rem; font-weight: 700; }
.cart-row .discount { color: var(--red); }
.btn-checkout {
    display: block; background: var(--primary); color: white;
    text-align: center; padding: 16px; border-radius: 10px;
    font-size: 1.05rem; font-weight: 700; text-decoration: none;
    margin-top: 24px; transition: background 0.2s;
}
.btn-checkout:hover { background: var(--primary-dark); }

/* ---- Checkout ---- */
.checkout-page { padding: 60px 0; }
.checkout-box { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; max-width: 700px; margin: 0 auto; }
.checkout-box h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 1rem; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.btn-next {
    width: 100%; background: var(--primary); color: white; border: none;
    padding: 16px; border-radius: 10px; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: background 0.2s; margin-top: 8px;
}
.btn-next:hover { background: var(--primary-dark); }
.notice-box {
    background: var(--yellow-bg); border-left: 4px solid #f59e0b;
    padding: 16px 20px; border-radius: 8px; margin-top: 24px;
    font-size: 0.88rem; color: #78350f; line-height: 1.7;
}

/* ---- Thank You ---- */
.thankyou-page { padding: 80px 0; text-align: center; }
.thankyou-box { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 60px 40px; max-width: 600px; margin: 0 auto; }
.thankyou-icon { font-size: 4rem; margin-bottom: 20px; }
.thankyou-box h1 { font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.thankyou-box p { color: var(--text-light); line-height: 1.8; margin-bottom: 10px; }
.delivery-days { font-weight: 700; color: var(--text); }
.btn-continue { display: inline-block; background: var(--primary); color: white; padding: 14px 36px; border-radius: 50px; font-weight: 700; text-decoration: none; margin-top: 28px; transition: background 0.2s; }
.btn-continue:hover { background: var(--primary-dark); }

/* ---- Static Pages ---- */
.static-page { padding: 60px 0; }
.static-box { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 50px; max-width: 900px; margin: 0 auto; }
.static-box h1 { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 40px; }
.static-box h2 { font-size: 1.3rem; font-weight: 700; margin: 30px 0 12px; }
.static-box p { color: var(--text-light); line-height: 1.8; margin-bottom: 12px; }
.static-box ul { padding-left: 20px; color: var(--text-light); line-height: 2; }

/* FAQ */
.faq-section h2 { font-size: 1.4rem; font-weight: 700; margin: 30px 0 16px; border-bottom: 2px solid var(--primary); padding-bottom: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.faq-question { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; cursor: pointer; font-weight: 600; background: white; }
.faq-question:hover { background: var(--bg); }
.faq-answer { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s, padding 0.3s; color: var(--text-light); }
.faq-item.open .faq-answer { max-height: 300px; padding: 16px 20px; }
.faq-arrow { transition: transform 0.3s; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form-section h2, .contact-info-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.contact-info-item { margin-bottom: 24px; }
.contact-info-item h3 { font-weight: 700; margin-bottom: 4px; }
.contact-info-item p { color: var(--text-light); }
.btn-send { background: var(--primary); color: white; border: none; padding: 14px 36px; border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.btn-send:hover { background: var(--primary-dark); }

/* ---- Footer ---- */
.site-footer { background: var(--text); color: white; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; padding: 50px 0; }
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; gap: 30px; } }
.footer-logo { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.footer-brand p { color: rgba(255,255,255,0.6); font-size: 0.9rem; line-height: 1.6; }
.footer-links h4 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); text-align: center; padding: 20px; font-size: 0.85rem; color: rgba(255,255,255,0.5); }

/* ---- In-content ad ---- */
.ad-incontent { text-align: center; margin: 40px 0; }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.empty-cart { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-cart svg { margin-bottom: 16px; opacity: 0.3; }
.empty-cart h2 { font-size: 1.4rem; margin-bottom: 8px; }
.empty-cart a { color: var(--primary); }

/* ---- Breadcrumb ---- */
.breadcrumb { font-size: 0.85rem; color: var(--text-light); padding: 16px 0; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

/* ---- Alert / Toast ---- */
.alert { padding: 14px 20px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; }
.alert-success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.alert-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

@media (max-width: 480px) {
    .static-box { padding: 24px; }
    .checkout-box { padding: 24px; }
    .cart-box { padding: 20px; }
    .thankyou-box { padding: 40px 20px; }
    .product-detail { padding: 30px 0; }
}
