/* ==========================================================
   EKSEN PRO v1.2 FINAL — COMPLETE MOBILE LAYER
   Safe additive overrides. Desktop layout remains unchanged.
   ========================================================== */

html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
html,body{max-width:100%;overflow-x:hidden}
body{min-width:320px}
img,svg,video,canvas,iframe{max-width:100%;height:auto}
input,select,textarea,button{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
.container-app{width:min(1320px,calc(100% - 28px));margin-inline:auto;min-width:0}
*{min-width:0}
table{max-width:100%}

/* Shared safe wrapping */
.break-anywhere,.product-name,.cart-product-name{overflow-wrap:anywhere;word-break:break-word}
.prose,.product-description{overflow-wrap:anywhere}
main{min-width:0}

/* Touch comfort */
@media (pointer:coarse){
  button,.btn,.btn-primary,.btn-outline,a[role="button"]{min-height:42px}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px}
}

/* Tablet and below */
@media (max-width:1023px){
  .container-app{width:min(100% - 24px,960px)}
  main{padding-bottom:8px}

  /* Header */
  header{max-width:100vw}
  header .container-app{min-width:0}
  header form[action="/arama"],header [data-search-form]{width:100%;max-width:none}
  header input[type="search"]{width:100%;min-width:0}
  [data-mega-menu],[data-category-mega]{max-width:calc(100vw - 24px);left:12px!important;right:12px!important}

  /* Home */
  .eh-home{padding-top:10px!important;padding-bottom:32px!important}
  .eh-shell{width:calc(100% - 20px)!important}
  .eh-hero-grid{grid-template-columns:1fr!important}
  .eh-category-menu{display:none!important}
  .eh-slider{min-width:0!important}
  .eh-slider img{width:100%!important;object-fit:cover}
  .eh-category-chips{overflow:hidden}
  .eh-category-chip-track,.eh-product-strip{scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
  .eh-product-item{scroll-snap-align:start}
  .eh-strip-arrow{display:none!important}
  .eh-section-head{gap:10px}
  .eh-section-head>div{min-width:0}
  .eh-section-head h2{overflow-wrap:anywhere}
  .eh-benefits{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  /* Category */
  .eksen-category-layout{display:block!important}
  .eksen-category-main{width:100%;min-width:0}
  #filter-drawer{width:min(88vw,360px)!important;max-width:100vw}
  .eksen-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}

  /* Product */
  .product-detail-grid{grid-template-columns:1fr!important}
  [data-product-gallery]{position:static!important}
  .product-sticky-buy{position:static!important}
  [data-thumb-group]{display:flex!important;overflow-x:auto;padding-bottom:4px;scroll-snap-type:x mandatory}
  [data-thumb-group]>button{flex:0 0 64px;scroll-snap-align:start}
  .product-tabs{overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}

  /* Forms, carts and checkout */
  .checkout-layout,.cart-layout,.account-layout{grid-template-columns:1fr!important}
  .checkout-summary,.cart-summary{position:static!important;width:100%!important}
  .table-responsive,.overflow-x-auto{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table-responsive table{min-width:680px}
  .account-sidebar{position:static!important;width:100%!important}
}

/* Phones */
@media (max-width:767px){
  :root{--mobile-edge:10px}
  .container-app{width:calc(100% - 20px)}
  body{font-size:14px}
  main{width:100%}
  section{max-width:100%}
  h1{overflow-wrap:anywhere}

  /* Header */
  header .topbar,header [data-topbar]{display:none!important}
  header .container-app{padding-left:0!important;padding-right:0!important}
  header img[alt*="logo" i],header a[href="/"] img{max-width:150px!important;max-height:42px!important;object-fit:contain}
  header .hidden.md\:flex,header .hidden.lg\:flex{display:none!important}
  header input[type="search"]{height:44px!important;border-radius:12px!important}
  header button,header a{flex-shrink:0}
  header .mobile-menu-panel{width:min(90vw,360px)!important;max-width:100vw}
  header [class*="shadow-modal"]{max-width:calc(100vw - 20px)}

  /* Home hero */
  .eh-home{padding:8px 0 26px!important}
  .eh-shell{width:calc(100% - 16px)!important}
  .eh-hero-grid{gap:8px!important}
  .eh-slider{border-radius:12px!important;overflow:hidden}
  .eh-slider,.eh-slider-track,.eh-slide{aspect-ratio:16/8.6!important;min-height:0!important}
  .eh-slider img{height:100%!important}
  .eh-slider-content{padding:16px!important}
  .eh-slider-content h1,.eh-slider-content h2{font-size:22px!important;line-height:1.12!important}
  .eh-slider-content p{font-size:12px!important;line-height:1.45!important;max-width:72%!important}
  .eh-slider-content a{min-height:40px!important;padding:0 14px!important;font-size:12px!important}
  .eh-slider-dots{bottom:8px!important}

  .eh-category-chips,.eh-section,.eh-benefits{border-radius:12px!important}
  .eh-category-chips{padding:10px!important}
  .eh-category-chip-track{display:flex!important;overflow-x:auto!important;gap:8px!important;padding-bottom:3px}
  .eh-category-chip{flex:0 0 88px!important;min-width:88px!important;padding:8px 5px!important}
  .eh-category-chip strong{font-size:10px!important;line-height:1.2!important}
  .eh-category-chip span{width:42px!important;height:42px!important}

  .eh-benefits{grid-template-columns:1fr 1fr!important;gap:0!important}
  .eh-benefit{padding:12px 10px!important;min-height:72px}
  .eh-benefit strong{font-size:11px!important}
  .eh-benefit small{font-size:9px!important}
  .eh-benefit svg{width:20px!important;height:20px!important}

  .eh-section{padding:12px!important;margin-top:10px!important}
  .eh-section-head{align-items:flex-start!important;margin-bottom:10px!important}
  .eh-section-head span{font-size:9px!important}
  .eh-section-head h2{font-size:17px!important;line-height:1.2!important}
  .eh-section-head>a{font-size:10px!important;white-space:nowrap}
  .eh-product-strip{display:flex!important;overflow-x:auto!important;gap:9px!important;padding:1px 1px 7px!important}
  .eh-product-item{flex:0 0 min(74vw,245px)!important;width:min(74vw,245px)!important}
  .eh-product-card{height:100%}
  .eh-product-media{aspect-ratio:1/1!important}
  .eh-product-body{padding:10px!important}
  .eh-product-body h3{font-size:12px!important;line-height:1.35!important;min-height:2.7em}
  .eh-product-price-row strong{font-size:16px!important}
  .eh-card-actions{opacity:1!important;transform:none!important}

  /* Product grids */
  .eksen-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .eksen-product-grid article,.product-card{border-radius:12px!important}
  .product-card .p-4,.eksen-product-grid article .p-4{padding:9px!important}
  .product-card h3,.product-card [class*="font-bold"]{font-size:11px!important;line-height:1.35!important}
  .product-card [class*="text-xl"]{font-size:15px!important}
  .product-card button,.product-card .btn-primary{min-height:38px!important;padding-inline:9px!important}

  /* Category toolbar and drawer */
  .eksen-category-main>div{border-radius:12px!important}
  .eksen-category-main h1{font-size:20px!important}
  #filter-drawer-btn{min-width:94px}
  .eksen-category-main select[name="sort"]{width:128px!important;max-width:38vw;font-size:12px}
  #filter-drawer{width:min(92vw,360px)!important}
  #filter-drawer .sticky{padding-top:max(12px,env(safe-area-inset-top))}

  /* Product detail */
  main section.container-app{padding-top:12px!important;padding-bottom:16px!important}
  main section.container-app nav{white-space:nowrap;overflow-x:auto;padding-bottom:4px}
  .lg\:grid-cols-\[1\.1fr_1fr\]{grid-template-columns:1fr!important}
  #main-image{padding:18px!important}
  [data-thumb-group]{gap:8px!important}
  .product-info h1,main section.container-app h1.text-2xl{font-size:20px!important;line-height:1.28!important}
  .product-info .text-3xl,.product-info .text-4xl{font-size:24px!important}
  .product-actions,.buy-actions{display:grid!important;grid-template-columns:1fr!important}
  .quantity-control{width:100%}
  .add-to-cart,.btn-add-cart{width:100%!important;justify-content:center}
  .product-tabs{margin-left:-10px;margin-right:-10px;padding-left:10px;padding-right:10px}
  .product-tabs button,.product-tabs a{flex:0 0 auto}

  /* Popup */
  .eksen-popup-root{padding:8px!important;align-items:flex-end!important}
  .eksen-popup-card{width:100%!important;max-height:92dvh!important;grid-template-columns:1fr!important;border-radius:20px 20px 0 0!important}
  .eksen-popup-media{min-height:0!important;max-height:46dvh!important}
  .eksen-popup-media img{max-height:46dvh!important;object-fit:cover!important}
  .eksen-popup-content{padding:22px 18px calc(24px + env(safe-area-inset-bottom))!important}
  .eksen-popup-content h2{font-size:23px!important}
  .eksen-popup-button{width:100%!important}

  /* Cart/checkout */
  .cart-item{display:grid!important;grid-template-columns:76px minmax(0,1fr)!important;gap:10px!important}
  .cart-item-actions{grid-column:1/-1!important;display:flex!important;justify-content:space-between!important}
  .checkout-step,.checkout-card,.cart-summary{padding:14px!important;border-radius:14px!important}
  .checkout-layout input,.checkout-layout select,.checkout-layout textarea{width:100%!important}
  .payment-method{padding:12px!important}

  /* Account */
  .account-layout{display:block!important}
  .account-sidebar nav{display:flex!important;overflow-x:auto!important;gap:6px!important;padding-bottom:6px}
  .account-sidebar nav a{flex:0 0 auto!important;white-space:nowrap!important}

  /* Wizard */
  .wizard-page-wrap{width:calc(100% - 16px)!important;margin-inline:auto!important}
  .wizard-page-header{padding:10px!important;border-radius:12px!important}
  .wizard-page-header p{line-height:1.35}
  .wizard-shell{display:block!important;border-radius:12px!important;overflow:visible!important}
  .wizard-left{border-right:0!important;border-bottom:1px solid #e5e7eb!important;padding:9px!important;overflow:hidden}
  .wizard-left>h2{display:none}
  #wizard-nav{display:flex!important;overflow-x:auto!important;gap:7px!important;padding-bottom:4px!important;scroll-snap-type:x mandatory}
  .wizard-nav-item{flex:0 0 auto!important;width:auto!important;min-width:145px!important;scroll-snap-align:start;padding:8px!important}
  .wizard-main{min-height:420px!important}
  .wizard-panel .sticky{position:static!important;padding:12px!important}
  .wizard-panel .p-4{padding:10px!important}
  .wizard-products{display:grid!important;grid-template-columns:1fr!important}
  .wizard-product{grid-template-columns:64px minmax(0,1fr)!important;padding:9px!important}
  .wizard-product-actions{grid-column:1/-1!important;width:100%!important}
  .wizard-summary-col{border-left:0!important;border-top:1px solid #e5e7eb!important;position:static!important;width:100%!important}
  .wizard-summary-col .sticky{position:static!important}
  .wizard-summary-items{max-height:none!important}
  .wizard-summary-col button{width:100%!important}

  /* Footer */
  footer{padding-bottom:calc(16px + env(safe-area-inset-bottom))}
  footer .grid{grid-template-columns:1fr!important}
  footer details{border-bottom:1px solid rgba(148,163,184,.18)}
  footer a{overflow-wrap:anywhere}

  /* Floating WhatsApp */
  [data-whatsapp],.whatsapp-float{right:12px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important}
}

/* Very small phones */
@media (max-width:380px){
  .container-app{width:calc(100% - 16px)}
  .eksen-product-grid{grid-template-columns:1fr!important}
  .eh-product-item{flex-basis:82vw!important;width:82vw!important}
  .eh-benefits{grid-template-columns:1fr!important}
  header img[alt*="logo" i],header a[href="/"] img{max-width:125px!important}
}

/* Landscape phone */
@media (max-height:500px) and (orientation:landscape){
  .eksen-popup-card{max-height:96dvh!important;grid-template-columns:1fr 1fr!important;border-radius:16px!important}
  .eksen-popup-media,.eksen-popup-media img{max-height:96dvh!important}
}
