/* ==========================================================================
   Shahid Electronics — Animations & polish
   Layout/design bilkul same hai, yahan sirf motion aur micro-interactions hain.
   ========================================================================== */

body { font-family: 'Inter', Arial, Helvetica, sans-serif; }

/* ---- Page preloader ---- */
.preloader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--navy); transition: opacity .5s ease, visibility .5s ease; }
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-inner { display: grid; justify-items: center; gap: 18px; }
.preloader .brand-mark { width: 58px; height: 58px; font-size: 20px; animation: pulse-mark 1.4s ease-in-out infinite; }
.preloader-bar { width: 150px; height: 2px; background: #1b3c62; overflow: hidden; border-radius: 2px; }
.preloader-bar span { display: block; height: 100%; width: 40%; background: var(--gold); animation: loader-slide 1.1s ease-in-out infinite; }
.preloader-text { color: #7f9cbd; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; }
@keyframes loader-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
@keyframes pulse-mark { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---- Scroll reveal ---- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); will-change: opacity, transform; }
[data-reveal="left"]  { transform: translateX(-34px); }
[data-reveal="right"] { transform: translateX(34px); }
[data-reveal="zoom"]  { transform: scale(.94); }
[data-reveal].revealed { opacity: 1; transform: none; }

/* ---- Sticky header ---- */
.header { transition: box-shadow .3s ease, background .3s ease; }
.header.is-stuck { position: sticky; top: 0; box-shadow: 0 6px 22px #0b285012; background: rgba(255,255,255,.95); backdrop-filter: saturate(180%) blur(8px); }
.header-inner { transition: height .3s ease; }
.header.is-stuck .header-inner { height: 68px; }

/* ---- Hero entrance ---- */
.hero-copy .eyebrow  { animation: rise-in .8s .05s both; }
.hero-copy h1        { animation: rise-in .8s .18s both; }
.hero-copy > p       { animation: rise-in .8s .30s both; }
.hero-actions        { animation: rise-in .8s .42s both; }
.hero-note           { animation: rise-in .8s .54s both; }
.hero-stat-card      { animation: rise-in .9s .66s both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.hero-image { animation: hero-zoom 16s ease-in-out infinite alternate; }
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.07); } }

/* Gold sweep under the italic hero word */
h1 em, h2 em { position: relative; }
h1 em::after { content: ''; position: absolute; left: 0; bottom: .08em; height: 3px; width: 0; background: var(--gold); opacity: .45; animation: sweep 1s .95s forwards; }
@keyframes sweep { to { width: 100%; } }

/* ---- Buttons & links ---- */
.button { position: relative; overflow: hidden; }
.button::after { content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.36), transparent); transform: skewX(-18deg); transition: left .55s ease; }
.button:hover::after { left: 130%; }
.button:active { transform: translateY(1px) scale(.99); }
.nav > a:not(.nav-cta) { position: relative; }
.nav > a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--red); transition: width .28s ease; }
.nav > a:not(.nav-cta):hover::after { width: 100%; }

/* ---- Trust bar ---- */
.trust-number { display: inline-block; transition: transform .3s ease; }
.trust-items > div:hover .trust-number { transform: translateY(-2px) scale(1.04); }
.trust-brands strong { transition: color .25s ease, transform .25s ease; }
.trust-brands strong:hover { color: var(--blue); transform: translateY(-2px); }

/* ---- Product cards ---- */
.product-card { animation: card-in .5s both; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.product-card.is-hidden { display: none; }
.product-image img { transition: transform .5s ease, opacity .4s ease; }
.product-card:hover .product-image img { opacity: .92; }
.product-tag { transition: background .25s ease, color .25s ease; }
.product-card:hover .product-tag { background: var(--blue); color: #fff; }
.category { position: relative; }
.category.active { box-shadow: inset 0 -2px 0 var(--blue); }
.products-empty { text-align: center; padding: 60px 0; color: var(--muted); font-size: 13px; }

/* ---- Service cards ---- */
.service-card { position: relative; overflow: hidden; }
.service-card::before { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--gold); transition: width .35s ease; }
.service-card:hover::before { width: 100%; }
.service-icon { transition: transform .35s ease; }
.service-card:hover .service-icon { transform: translateY(-3px) rotate(-6deg); }

/* ---- About ---- */
.about-photo img { transition: transform .6s ease, filter .6s ease; }
.about-photo:hover img { transform: scale(1.03); filter: saturate(1); }
.photo-badge { transition: transform .35s ease; }
.about-photo:hover .photo-badge { transform: translateY(-4px); }

/* ---- Calculator ---- */
.result { animation: result-in .45s ease both; }
@keyframes result-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.calculator-card { transition: box-shadow .3s ease; }
.calculator-card:hover { box-shadow: 0 20px 45px rgba(20,54,95,.1); }

/* ---- Testimonials ---- */
.testimonial-layout blockquote { transition: transform .35s ease, border-color .35s ease; }
.testimonial-layout blockquote:hover { transform: translateX(5px); border-left-color: var(--gold); }

/* ---- Contact ---- */
.contact-links a { transition: transform .25s ease; }
.contact-links a:hover { transform: translateX(5px); }
.contact-icon { transition: transform .25s ease, background .25s ease; }
.contact-links a:hover .contact-icon { transform: scale(1.08); }

/* ---- Inquiry form (naya section, site ke style me) ---- */
.inquiry-form { margin-top: 30px; display: grid; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 22px; box-shadow: 0 12px 32px rgba(20,54,95,.05); max-width: 420px; }
.inquiry-form h3 { font: 600 19px Georgia, serif; color: var(--navy); margin: 0; }
.inquiry-form > p { font-size: 11px; color: var(--muted); margin: -6px 0 4px; }
.inquiry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inquiry-form input, .inquiry-form textarea, .inquiry-form select { width: 100%; border: 1px solid #becddd; border-radius: 3px; padding: 11px 12px; font-size: 12px; color: var(--navy); outline: 0; font-family: inherit; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.inquiry-form input:focus, .inquiry-form textarea:focus, .inquiry-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13,77,145,.1); }
.inquiry-form textarea { resize: vertical; min-height: 78px; }
.inquiry-form .button { width: 100%; }
.form-note { font-size: 10px; color: var(--muted); text-align: center; }
.form-alert { font-size: 11px; padding: 10px 12px; border-radius: 3px; animation: result-in .4s both; }
.form-alert.ok { background: #dcf4e7; color: #147a4c; border-left: 3px solid #19a85b; }
.form-alert.err { background: #fdeaea; color: var(--red); border-left: 3px solid var(--red); }

/* ---- Floating WhatsApp ---- */
.floating-whatsapp { animation: float-in .6s 1.2s both; }
.floating-whatsapp::before { content: ''; position: absolute; inset: 0; border-radius: 50px; box-shadow: 0 0 0 0 rgba(25,168,91,.55); animation: wa-pulse 2.4s infinite; }
@keyframes wa-pulse { 70% { box-shadow: 0 0 0 16px rgba(25,168,91,0); } 100% { box-shadow: 0 0 0 0 rgba(25,168,91,0); } }
@keyframes float-in { from { opacity: 0; transform: translateY(22px) scale(.9); } to { opacity: 1; transform: none; } }

/* ---- Back to top ---- */
.back-to-top { position: fixed; right: 22px; bottom: 86px; z-index: 29; width: 42px; height: 42px; display: grid; place-items: center; border: 0; cursor: pointer; border-radius: 50%; background: var(--navy); color: #fff; opacity: 0; visibility: hidden; transform: translateY(12px); transition: .3s ease; box-shadow: 0 8px 22px rgba(7,29,59,.25); }
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--blue); transform: translateY(-3px); }

/* ---- Scroll progress ---- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--gold), var(--red)); z-index: 9998; transition: width .1s linear; }

/* ---- Mobile nav ---- */
.nav-open > a { animation: nav-item-in .35s both; }
.nav-open > a:nth-child(1) { animation-delay: .04s; }
.nav-open > a:nth-child(2) { animation-delay: .08s; }
.nav-open > a:nth-child(3) { animation-delay: .12s; }
.nav-open > a:nth-child(4) { animation-delay: .16s; }
.nav-open > a:nth-child(5) { animation-delay: .20s; }
@keyframes nav-item-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

@media (max-width: 850px) {
  .back-to-top { right: 14px; bottom: 74px; }
  .inquiry-form { max-width: 100%; }
}
@media (max-width: 470px) {
  .inquiry-row { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---- Custom logo (admin panel se upload hota hai) ---- */
.brand-logo { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 8px; background: transparent; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.footer .brand-logo, .admin-sidebar .brand-logo, .preloader .brand-logo { background: rgba(255,255,255,.08); }
.preloader .brand-logo { animation: pulse-mark 1.4s ease-in-out infinite; }
.admin-logo-preview { width: 90px; height: 90px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fc; padding: 6px; }
