/* App-specific styling for the demo clone (complements custom.css) */
:root{
    --brand:#9f2089;
    --brand-2:#c53ead;
    --green:#008c00;
    --ink:#212121;
    --muted:#717478;
    --line:#ececef;
    --bg:#f1f3f6;
}
*{box-sizing:border-box}

/* Mobile-first layout, matching the original (body is capped at 500px, centered) */
body{margin:0;font-family:Roboto,Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#e9ebee}
#container{background:#fff}

/* Page load loader */
.page-loader{position:fixed;inset:0;z-index:9999;background:#fff;display:flex;align-items:center;justify-content:center;transition:opacity .4s ease}
.page-loader.hidden{opacity:0;pointer-events:none}
.loader-inner{display:flex;flex-direction:column;align-items:center;gap:20px}
.loader-brand{font-size:26px;font-weight:800;letter-spacing:-.5px;color:var(--brand);text-transform:uppercase}
.loader-brand b{color:var(--brand-2)}
.loader-spinner{width:38px;height:38px;border:4px solid #f0d9ec;border-top-color:var(--brand);border-radius:50%;animation:loaderspin .7s linear infinite}
@keyframes loaderspin{to{transform:rotate(360deg)}}
a{text-decoration:none;color:inherit}
img{max-width:100%}

.page-wrap{margin:0 auto;padding:0 8px 40px}

/* Top ad slot (above header) — reserves NO space until a real ad fills it.
   collapseEmptyDivs() sets the inner GPT div to display:none when unfilled,
   so on localhost/empty state there is no visible gap. When an ad serves,
   GPT sizes the div and the row grows to fit. */
.top-ad{display:flex;justify-content:center;align-items:center;background:#f6f6f8}
.top-ad > div{margin:0 auto}
/* Give breathing room only when the ad iframe is actually present */
.top-ad > div:has(iframe){padding:6px 0}

/* Header */
.site-header{position:sticky;top:0;z-index:40;background:#fff;padding:9px 12px;box-shadow:0 1px 5px rgba(0,0,0,.10)}
.header-inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;gap:10px}
.logo-link{display:flex;align-items:center;flex:0 0 auto}
.site-logo{display:block;height:38px;width:auto;object-fit:contain}
.logo-text{font-size:19px;font-weight:800;letter-spacing:-.5px;color:var(--brand);text-transform:uppercase;white-space:nowrap}
.logo-text b{color:var(--brand-2);font-weight:800}
/* Search bar (fills the middle) */
.header-search{flex:1 1 auto;display:flex;align-items:center;gap:8px;background:#f2f3f5;border:1px solid #e6e7eb;border-radius:22px;padding:9px 14px;min-width:0;color:#9296a1}
.header-search:hover{border-color:var(--brand)}
.header-search-text{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.header-icon{position:relative;display:inline-flex;align-items:center;flex:0 0 auto}
.bubble-count{position:absolute;top:-6px;right:-8px;background:var(--brand);color:#fff;font-size:11px;line-height:1;min-width:16px;height:16px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px}
.d-none{display:none!important}

/* Categories strip */
.categories{background:#fff;border-bottom:1px solid var(--line)}
.cat-list{max-width:1200px;margin:0 auto;display:flex;gap:8px;padding:12px;overflow-x:auto}
.cat-list .category{flex:0 0 auto;text-align:center;width:88px}
.cat-list .category img{width:72px;height:72px;object-fit:cover;border-radius:50%;border:1px solid var(--line)}
.cat-list .category p{margin:6px 0 0;font-size:12px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Hero */
.hero{margin-top:12px;border-radius:8px;overflow:hidden}
.hero img{display:block;width:100%;border-radius:8px}

/* In-content home ad */
.home-ad{display:flex;justify-content:center;align-items:center;margin:12px 0}
.home-ad > div{margin:0 auto}

/* In-content product ad (below Add to Cart, above Product Details) */
.pd-ad{display:flex;justify-content:center;align-items:center;margin:16px 0}
.pd-ad > div{margin:0 auto}

/* Section title */
.section-title{font-size:19px;font-weight:600;margin:20px 4px 12px}

/* Product grid — 2 columns, tight gap (mobile) */
.product-list{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.product-card{width:100%;background:#fff;border-radius:8px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 1px 3px rgba(0,0,0,.08);transition:transform .15s,box-shadow .15s;border:1px solid #eee}
.product-card:hover{transform:translateY(-3px);box-shadow:0 6px 16px rgba(0,0,0,.12)}
.product-img{position:relative;aspect-ratio:1/1.2;height:auto;padding:0;background:#f6f6f8;overflow:hidden;border-radius:0}
.product-img img{width:100%;height:100%;object-fit:cover}
.product-details{padding:8px 10px 12px;overflow:visible;width:100%}
.product-name{font-size:13px;line-height:1.35;margin:0 0 8px;color:var(--ink);white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:35px;width:100%;text-overflow:ellipsis}
.product-price{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.sell-price{font-weight:700;font-size:15px;color:var(--ink)}
.mrp-price{font-size:12px;color:var(--muted)}
.line-through{text-decoration:line-through}
.off-percentage{font-size:12px;color:var(--green);font-weight:600}

/* Load more / pagination */
.load-more-wrap,.pagination-wrap{display:flex;justify-content:center;gap:6px;margin:24px 0;flex-wrap:wrap}
.btn{display:inline-block;border:none;cursor:pointer;border-radius:6px;font-size:14px;padding:10px 20px;background:var(--brand);color:#fff;font-weight:600}
.load-more-btn{background:#fff;color:var(--brand);border:1px solid var(--brand)}
.vv-page{padding:8px 14px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink);font-size:14px}
.vv-page.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.product_loader{text-align:center;color:var(--muted);padding:10px}
.empty-note,.muted{color:var(--muted)}

/* Product detail — single column (mobile-first, matches 500px container) */
.product-detail-page{display:block;background:#fff;border-radius:10px;padding:14px;margin-top:14px}
.pd-gallery{width:100%}
.pd-main{position:relative;border:1px solid var(--line);border-radius:10px;overflow:hidden;aspect-ratio:1/1.1;background:#fafafc;width:100%}
.pd-main img{width:100%;height:100%;object-fit:cover}
.pd-info{margin-top:18px}
.pd-badge{position:absolute;left:12px;top:12px;background:var(--green);color:#fff;font-size:12px;padding:5px 10px;border-radius:4px}
.pd-thumbs{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.pd-thumb{width:60px;height:60px;object-fit:cover;border:1px solid var(--line);border-radius:6px;cursor:pointer}
.pd-thumb.active{border-color:var(--brand)}
.pd-crumb{color:var(--brand);font-size:13px}
.pd-title{font-size:22px;font-weight:600;margin:6px 0 10px;line-height:1.3}
.star-list{display:flex;align-items:center;gap:2px;list-style:none;padding:0;margin:0 0 12px}
.rating-count{margin-left:8px;font-size:13px;color:var(--muted)}
.pd-price{display:flex;align-items:baseline;gap:10px;margin:10px 0}
.pd-price .price{font-size:26px;font-weight:700}
.pd-price .mrp{font-size:16px;color:var(--muted);text-decoration:line-through}
.pd-price .discount{color:var(--green);font-weight:600}
.pd-delivery{font-size:14px;margin:6px 0}
.free-del{color:var(--green);font-weight:600}
.pd-stock{font-size:13px;font-weight:600;margin:8px 0}
.pd-stock.in{color:var(--green)}.pd-stock.out{color:#d33}
.pd-buy{display:flex;align-items:center;gap:12px;margin:18px 0}
.qty-box{display:flex;align-items:center;border:1px solid var(--line);border-radius:6px;overflow:hidden;flex:0 0 auto}
.qty-box button{width:40px;height:48px;border:none;background:#f6f6f8;font-size:18px;cursor:pointer}
.qty-box input{width:42px;height:48px;border:none;text-align:center;font-size:15px}
.buynow-button{background:var(--brand);color:#fff;border:none;border-radius:6px;padding:0 20px;height:48px;font-size:16px;font-weight:600;cursor:pointer;flex:1;white-space:nowrap}
.product-detail-desc{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}
.product-detail-desc h6{font-size:16px;font-weight:700;margin:0 0 10px}
.product-details p{font-size:14px;line-height:1.6;color:#333;white-space:normal;margin:0}

/* Cart sidebar */
.overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:60}
.sidenav{position:fixed;top:0;right:-100%;width:360px;max-width:90vw;height:100%;background:#fff;z-index:70;transition:right .3s;display:flex;flex-direction:column;box-shadow:-4px 0 18px rgba(0,0,0,.15)}
.sidenav.open{right:0}
.cart-header{display:flex;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--line)}
.cart-header h3{margin:0;font-size:17px}
.closebtn{font-size:28px;line-height:1;color:var(--muted)}
.cart-products-list{flex:1;overflow-y:auto;padding:10px 16px}
.cart-product{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.cart-product-img img{width:56px;height:56px;object-fit:cover;border-radius:6px}
.cart-product-title{font-size:13px;line-height:1.3}
.cart-product-pricing{display:flex;justify-content:space-between;margin-top:4px}
.cart-product-price{font-weight:700;margin:0;font-size:14px}
.cart-qty{font-size:12px;color:var(--muted)}
.cart-empty{color:var(--muted);text-align:center;padding:30px 0}
.cart__price__details{border-top:1px solid var(--line);padding:16px}
.cart-row{display:flex;justify-content:space-between;font-size:14px;margin-bottom:8px}
.cart-row.total{font-size:16px;font-weight:700;align-items:center}
.cart-row.total h2{font-size:18px;margin:0}
.free-ship{color:var(--green);font-weight:600}
.cart__confirm__order{display:block;text-align:center;margin-top:10px;background:#2874f0}

/* Cart page */
.cart-page,.checkout-page,.search-page,.static-page,.order-success{background:transparent}
.cart-grid,.checkout-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:20px;align-items:start}
.cart-items{background:#fff;border-radius:8px;overflow:hidden}
.cart-line{display:flex;gap:14px;padding:16px;border-bottom:1px solid var(--line)}
.cart-line-img img{width:90px;height:90px;object-fit:cover;border-radius:6px}
.cart-line-main{flex:1}
.cart-line-name{font-size:14px;font-weight:500}
.cart-line-price{margin:6px 0}
.cart-line-price .line-through{color:var(--muted);font-size:13px;margin-left:6px}
.cart-line-actions{display:flex;gap:14px;align-items:center;margin-top:8px}
.qty-inline{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:6px;padding:2px 8px}
.qty-inline button{border:none;background:none;font-size:16px;cursor:pointer;color:var(--brand)}
.remove-btn{border:none;background:none;color:#d33;cursor:pointer;font-size:13px}
.cart-line-sub{font-weight:700;font-size:15px}
.cart-summary{background:#fff;border-radius:8px;padding:18px;position:sticky;top:80px}
.cart-summary h3{margin:0 0 14px;font-size:16px;border-bottom:1px solid var(--line);padding-bottom:10px}
.checkout-btn,.shop-btn{display:block;text-align:center;margin-top:14px;width:100%}
.cart-empty-page{background:#fff;border-radius:8px;padding:60px 20px;text-align:center}
.cart-empty-page .shop-btn{display:inline-block;width:auto;margin-top:16px}

/* Checkout */
.checkout-form{background:#fff;border-radius:8px;padding:20px;display:flex;flex-direction:column;gap:14px}
.checkout-form h3{margin:0 0 6px}
.checkout-form label{display:flex;flex-direction:column;font-size:13px;font-weight:600;gap:6px}
.checkout-form input,.checkout-form textarea{border:1px solid var(--line);border-radius:6px;padding:10px;font-size:14px;font-weight:400}
.alert-error{background:#fdecec;color:#c0392b;border:1px solid #f5c6cb;border-radius:6px;padding:12px 14px;margin-bottom:14px}
.order-success{background:#fff;border-radius:8px;padding:50px 20px;text-align:center;max-width:520px;margin:30px auto}
.success-icon{width:70px;height:70px;border-radius:50%;background:var(--green);color:#fff;font-size:36px;display:flex;align-items:center;justify-content:center;margin:0 auto 18px}
.order-no{font-size:22px;font-weight:700;color:var(--brand);letter-spacing:1px;margin:10px 0}

/* Search + static */
.search-form{display:flex;gap:8px;margin:18px 0}
.search-form input{flex:1;border:1px solid var(--line);border-radius:6px;padding:12px;font-size:14px}
.search-form button{background:var(--brand);color:#fff;border:none;border-radius:6px;padding:0 22px;cursor:pointer}
.static-page{background:#fff;border-radius:8px;padding:24px 20px;margin-top:16px;line-height:1.7}
.static-page h1{font-size:22px;margin:0 0 16px;padding-bottom:12px;border-bottom:2px solid var(--brand);color:var(--brand)}
.static-content h3{font-size:16px;margin:18px 0 6px;color:var(--ink)}
.static-content h4{font-size:15px;margin:0 0 4px;color:var(--ink)}
.static-content p{margin:0 0 12px;font-size:14px;color:#333}
.static-content ul{margin:0 0 14px;padding-left:20px}
.static-content li{font-size:14px;margin-bottom:6px}
.static-content a{color:var(--brand);font-weight:600}
.static-content .faq{padding:12px 0;border-bottom:1px solid var(--line)}
.static-content .contact-block{background:#faf6fb;border:1px solid #f0e2ee;border-radius:8px;padding:14px 16px;margin:14px 0}
.static-content .note{font-size:12px;color:var(--muted);font-style:italic}
.static-back{display:inline-block;width:auto;margin-top:18px}
.error-page{text-align:center}.error-page h1{font-size:64px;color:var(--brand)}

/* Footer */
.site-footer{background:#1c1c1c;color:#bbb;padding:36px 20px 0;margin-top:40px}
.footer-cols{max-width:1200px;margin:0 auto;display:flex;flex-wrap:wrap;gap:60px}
.footer-col h4{color:#fff;font-size:15px;margin:0 0 12px}
.footer-col ul{list-style:none;padding:0;margin:0 0 18px}
.footer-col li{margin-bottom:8px;font-size:13px}
.footer-col a:hover{color:#fff}
.footer-bottom{max-width:1200px;margin:24px auto 0;border-top:1px solid #333;padding:14px 0;font-size:13px;text-align:center}

@media (max-width:800px){
    .product-detail-page{grid-template-columns:1fr}
    .cart-grid,.checkout-grid{grid-template-columns:1fr}
    .cart-summary{position:static}
    .footer-cols{gap:30px}
    .product-list{grid-template-columns:repeat(2,1fr)}
    .section-title{font-size:17px}
}
