/* Premium V8 — database-safe UI, standardized media, responsive devices */
:root{
  --v8-coral:#c8755e;--v8-coral-dark:#a9513e;--v8-cream:#fff8f4;--v8-paper:#fffdfb;
  --v8-line:#ead9d1;--v8-ink:#28211e;--v8-muted:#746963;--v8-green:#72907c;
  --v8-shadow:0 18px 52px rgba(72,48,38,.08);--v8-radius:22px;
}
*,*::before,*::after{box-sizing:border-box}
html{font-size:16px;scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;min-width:320px;overflow-x:hidden;color:var(--v8-ink);font-family:"Vazirmatn",Tahoma,Arial,sans-serif;text-rendering:optimizeLegibility}
body.menu-open,body.admin-menu-open{overflow:hidden;touch-action:none}
img,video,svg,canvas{display:block;max-width:100%}
img,video{width:100%;height:auto}
button,input,textarea,select{font:inherit}
a,button{touch-action:manipulation}
.container{width:min(1240px,calc(100% - 48px));margin-inline:auto}
main{min-height:55vh}

/* Media always stays inside its intended frame */
figure{margin:0;min-width:0;max-width:100%}
.v4-hero-photo,.v4-about-photo,.v4-comparison,.v4-article-card,.svc5-hero-photo,.svc5-media,.svc5-treatment,.svc5-results-frame,.svc5-doctor-inner,.svc5-related-card,.v6-reel-card,.media-slot-preview{overflow:hidden}
.v4-hero-photo{aspect-ratio:1.17/1;min-height:0!important}
.v4-hero-photo>img,.v8-home-hero-image{width:100%!important;height:100%!important;object-fit:contain!important;object-position:center bottom!important}
.v4-about-photo{aspect-ratio:4/3}
.v4-about-photo>img{width:100%!important;height:100%!important;object-fit:cover!important;object-position:center 28%!important}
.v4-article-card>img{width:100%!important;aspect-ratio:16/9!important;height:auto!important;object-fit:cover!important;object-position:center!important}
.v4-comparison .before-after{aspect-ratio:1/1!important;max-height:620px}
.before-after{position:relative;overflow:hidden;isolation:isolate;background:#eee}
.before-after-image{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;object-fit:cover!important;object-position:center 28%!important}
.before-image{clip-path:inset(0 calc(100% - var(--position,50%)) 0 0)}
.before-after-range{position:absolute!important;inset:0!important;z-index:6!important;width:100%!important;height:100%!important;opacity:0!important;cursor:ew-resize!important;margin:0!important}
.before-after-divider{z-index:5!important;pointer-events:none}

/* Service media dimensions */
.service-v5 .svc5-hero-photo{aspect-ratio:4/3!important;max-height:560px}
.service-v5 .svc5-hero-photo img{width:100%!important;height:100%!important;object-fit:cover!important;object-position:center 27%!important}
.service-v5 .svc5-media,.service-v5 .svc5-treatment{aspect-ratio:16/9!important;max-height:560px!important;position:relative!important}
.service-v5 .svc5-managed-media>img,.service-v5 .svc5-managed-media>video{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important}
.svc5-results-frame{width:min(100%,820px)!important;margin-inline:auto!important;padding:10px!important}
.svc5-results-frame .before-after{width:100%!important;aspect-ratio:1/1!important;max-height:800px!important;border-radius:16px!important}
.svc5-doctor-inner>img{width:100%!important;height:100%!important;min-height:280px!important;object-fit:cover!important;object-position:center 25%!important}
.svc5-related-card>img{width:100%!important;aspect-ratio:16/10!important;height:auto!important;object-fit:cover!important}

/* Reels are portrait and never expand beyond the card */
.v6-reels-grid,.v6-service-reels-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,320px))!important;justify-content:center!important;gap:22px!important;max-width:1080px!important;margin-inline:auto!important}
.v6-reel-card,.svc7-reel-card{width:100%!important;min-width:0!important;border-radius:24px!important;background:#171412!important;overflow:hidden!important;box-shadow:var(--v8-shadow)!important}
.v6-reel-card>video,.v6-reel-card>img,.svc7-reel-card>video,.svc7-reel-card>img,.v8-reel-video{display:block!important;width:100%!important;height:auto!important;aspect-ratio:9/16!important;max-height:570px!important;object-fit:cover!important;object-position:center!important;background:#171412!important}
.v6-reel-card>div:not(.svc7-reel-overlay){padding:14px 16px;background:#fff}
.v6-reel-card>div:not(.svc7-reel-overlay) span{display:none}
.svc7-reel-overlay{position:absolute!important;right:12px!important;left:12px!important;bottom:12px!important}

/* Less visual clutter and better reading rhythm */
.v4-section,.svc5-section{padding-block:70px}
.v4-section-title,.svc5-heading{max-width:760px;margin-inline:auto;text-align:center}
.v4-section-title p,.svc5-heading p{max-width:680px;margin-inline:auto;line-height:2}
.v4-service-card,.v4-article-card,.svc5-info-card,.svc5-care-card,.svc5-related-card{box-shadow:0 10px 34px rgba(72,48,38,.055)!important}
.v4-service-card p,.svc5-related-card p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.v4-hero-copy p,.v4-about-copy p,.svc5-hero-copy p,.svc5-text p,.svc5-care-card p,.svc5-info-card p{font-size:15px!important;line-height:2.05!important}
.v4-checks li,.svc5-checks li{font-size:14px!important;line-height:2!important}
.v4-service-card h3,.svc5-related-card h3{line-height:1.65}
.v4-appointment-inner,.svc5-booking-inner{box-shadow:0 10px 35px rgba(72,48,38,.05)}

/* Robust mobile menu */
.v4-menu-toggle{position:relative!important;z-index:1002!important;display:none;flex-direction:column;justify-content:center;align-items:center;width:48px!important;height:48px!important;min-width:48px!important;padding:10px!important;border:1px solid var(--v8-line)!important;border-radius:14px!important;background:#fff!important;cursor:pointer!important}
.v4-menu-toggle span{width:23px!important;height:2px!important;margin:3px 0!important;background:var(--v8-coral-dark)!important}
.mobile-nav-backdrop{z-index:998!important}
.v4-nav{z-index:999!important}
.v5-nav-head button{width:44px;height:44px;display:grid;place-items:center;cursor:pointer}

/* Forms: prevent double click and improve touch */
button[disabled],.is-submitting{opacity:.62!important;cursor:not-allowed!important;pointer-events:none!important}
.time-slot.is-reserved{opacity:.38;pointer-events:none;text-decoration:line-through}
.time-slot.is-reserved span::after{content:"رزرو";font-size:9px;margin-right:4px;color:#a45f4d}
.time-slots.is-loading{opacity:.55;pointer-events:none}
.booking-step input,.booking-step textarea,.booking-step button,.booking-step label{font-size:15px}

/* Admin responsive UI */
.admin-pagination{display:flex;align-items:center;justify-content:center;gap:14px;padding:20px 0 2px}
.admin-pagination a{padding:9px 18px;border:1px solid var(--v8-line);border-radius:11px;background:#fff;color:var(--v8-coral-dark);font-weight:800}
.admin-pagination span{font-size:13px;color:var(--v8-muted)}
.admin-table td a{color:inherit}
.media-slot-preview img,.media-slot-preview video{width:100%!important;height:100%!important;object-fit:contain!important;background:#f5f0ed!important}
.media-slot-preview video{object-fit:contain!important}
.media-slot-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}.media-slot-meta span{font-size:11px;padding:5px 8px;border-radius:999px;background:#f6eeea;color:#745e54}
.admin-auth-body .login-card{box-shadow:0 24px 80px rgba(65,39,30,.1)}

@media(max-width:1100px){
  .container{width:min(100% - 36px,980px)}
  .v6-reels-grid,.v6-service-reels-grid{grid-template-columns:repeat(3,minmax(0,280px))!important}
  .svc5-hero-grid{grid-template-columns:1fr 1fr!important}.svc5-summary{grid-column:1/-1!important}
}
@media(max-width:900px){
  .v4-menu-toggle{display:flex!important}
  .v4-nav{position:fixed!important;top:0!important;right:0!important;bottom:0!important;width:min(88vw,390px)!important;height:100dvh!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important;padding:92px 24px 30px!important;background:#fff!important;transform:translateX(105%)!important;transition:transform .28s ease!important;overflow-y:auto!important;overscroll-behavior:contain!important;pointer-events:none!important;box-shadow:-24px 0 70px rgba(36,25,21,.18)!important}
  .v4-nav.is-open{transform:translateX(0)!important;pointer-events:auto!important}
  .v4-nav>a{font-size:16px!important;padding:14px 4px!important;border-bottom:1px solid #f0e4de!important}
  .v5-nav-head{display:flex!important;position:absolute;top:20px;right:24px;left:24px;align-items:center;justify-content:space-between}
  .mobile-nav-backdrop{display:block!important;position:fixed!important;inset:0!important;background:rgba(31,23,20,.45)!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;transition:.25s!important}
  .mobile-nav-backdrop.is-open{opacity:1!important;visibility:visible!important;pointer-events:auto!important}
  .v4-menu-toggle.is-open{position:fixed!important;top:18px!important;right:18px!important}
  .v4-hero-grid,.v4-about-grid,.v4-quality-grid,.svc5-intro-grid,.svc5-tech-grid{grid-template-columns:1fr!important}
  .v4-hero-photo{max-width:680px;margin-inline:auto}
  .svc5-hero-grid{display:flex!important;flex-direction:column!important}.svc5-hero-photo{order:1}.svc5-hero-copy{order:2}.svc5-summary{order:3}
  .svc5-doctor-inner{grid-template-columns:1fr!important}.svc5-doctor-inner>img{aspect-ratio:16/9;min-height:0!important}
  .v6-reels-grid,.v6-service-reels-grid{display:flex!important;justify-content:flex-start!important;overflow-x:auto!important;scroll-snap-type:x mandatory!important;gap:16px!important;margin-inline:calc(50% - 50vw)!important;padding:4px 18px 20px!important;max-width:none!important;scrollbar-width:thin}
  .v6-reel-card,.svc7-reel-card{flex:0 0 min(72vw,310px)!important;scroll-snap-align:center!important}
}
@media(max-width:700px){
  html{font-size:16px}.container{width:calc(100% - 24px)}
  .v4-promo{display:none!important}
  .v4-header{min-height:72px!important}.v4-header-inner{min-height:72px!important}
  .v4-section,.svc5-section{padding-block:48px!important}
  .v4-hero{padding-top:22px!important}.v4-hero-copy h1{font-size:clamp(30px,9vw,40px)!important}.v4-hero-copy p{font-size:15px!important}
  .v4-hero-photo{aspect-ratio:1/1!important}.v4-hero-photo>img{object-fit:contain!important}
  .v4-service-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.v4-service-card{min-height:210px!important;padding:16px 12px!important}.v4-service-card p{font-size:12px!important}
  .v4-feature-strip{grid-template-columns:repeat(2,1fr)!important}
  .v4-articles-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.v4-article-card>div{padding:12px!important}.v4-article-card h3{font-size:13px!important}
  .svc5-hero-photo{aspect-ratio:1/1!important}.svc5-hero-copy h1{font-size:32px!important}.svc5-hero-copy h2{font-size:19px!important}
  .svc5-summary{grid-template-columns:repeat(2,1fr)!important}.svc5-summary article{min-width:0!important}
  .svc5-results-frame{padding:6px!important;border-radius:18px!important}.svc5-results-frame .before-after{border-radius:13px!important}
  .svc5-info-cards,.svc5-care-grid,.svc5-related-grid{grid-template-columns:1fr!important}
  .svc5-media,.svc5-treatment{aspect-ratio:4/3!important}
  .v6-reel-card,.svc7-reel-card{flex-basis:min(80vw,300px)!important}.v6-reel-card>video,.v6-reel-card>img,.svc7-reel-card>video,.svc7-reel-card>img{max-height:none!important}
  .v4-mobile-bar{height:68px!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important}.v4-mobile-bar a{font-size:13px!important}
  .admin-main{padding-inline:12px!important}.admin-table-responsive thead{display:none}.admin-table-responsive,.admin-table-responsive tbody,.admin-table-responsive tr,.admin-table-responsive td{display:block;width:100%}.admin-table-responsive tr{margin-bottom:14px;padding:12px;border:1px solid var(--v8-line);border-radius:14px;background:#fff}.admin-table-responsive td{display:grid;grid-template-columns:92px 1fr;gap:10px;padding:9px 0!important;border-bottom:1px dashed #eee!important}.admin-table-responsive td:last-child{border-bottom:0!important}.admin-table-responsive td::before{content:attr(data-label);font-size:12px;font-weight:800;color:var(--v8-muted)}
  .media-slot-preview{height:260px!important}.media-guide-panel{grid-template-columns:1fr!important}
}
@media(max-width:420px){
  .container{width:calc(100% - 20px)}
  .v4-brand b{font-size:12px!important}.v4-brand small{font-size:9px!important}
  .v4-service-grid,.v4-articles-grid{grid-template-columns:1fr 1fr!important}
  .v4-service-card{min-height:200px!important}.v4-service-card h3{font-size:14px!important}
  .svc5-summary{grid-template-columns:1fr 1fr!important}.svc5-summary b{font-size:12px!important}
  .booking-step{padding:18px 12px!important}.time-slots{grid-template-columns:repeat(2,1fr)!important}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
.system-check-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.system-check.is-ok .admin-stat-icon{background:#e9f5ee;color:#397454}.system-check.is-error{border-color:#e7b6a7;background:#fff8f5}.system-check.is-error .admin-stat-icon{background:#fbe5df;color:#a34b38}.system-check b{font-size:16px!important}@media(max-width:900px){.system-check-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.system-check-grid{grid-template-columns:1fr}}
