/* Kamagra-Now presentation fixes for So-eMarket 3.0.1 (loaded through So Theme Config >
   Custom CSS file; kept separate from the theme's own files so theme updates don't erase it). */

/* Desktop header: login + phone live in the top bar on large screens (see OCMod kn_customisations). */
@media (min-width: 1200px) {
  #header .header-top .kn-top-account { margin: 0 18px 0 0; vertical-align: middle; }
  #header .header-top .kn-top-account > li { display: inline-block; padding: 0 0 0 16px; font-size: 13px; line-height: 20px; color: #fff; }
  #header .header-top .kn-top-account > li a { color: #fff; }
  #header .header-top .kn-top-account > li a:hover { color: #ff3e20; }
  #header .header-top .kn-top-account .kn-phone ul, #header .header-top .kn-top-account .kn-phone li { display: inline; margin: 0; padding: 0; list-style: none; }
  #header .header-top .kn-top-account .fa { margin-right: 4px; }
  #header .header-top-right { text-align: right; }
  #header .header-top-right .lang-curr { display: inline-block; vertical-align: middle; }
  #header .header-top-left { width: 50%; }
  #header .header-top-right { width: 50%; }
  /* 8 menu items + logo on one row from 1200px up */
  #header .main-menu ul.megamenu > li { margin-right: 26px; }
}
@media (min-width: 1200px) and (max-width: 1439px) {
  #header .main-menu ul.megamenu > li { margin-right: 16px; }
}

/* Product page: sticky "buy now" bar title (was a second <h1>), same look as before. */
.sticky-detail .product-cont .kn-sticky-title { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 0 0 5px; color: #222; }

/* Product page: the main image is lazy-loaded from a 1px placeholder, so the page jumped by ~600px
   when it arrived (layout shift, also on the old shop). Product popups are always square (OpenCart pads
   them to 1000x1000), so reserve a square box up front. */
.large-image img.product-image-zoom { aspect-ratio: 1 / 1; width: 100%; height: auto; }

/* Product thumbnails (category, search, specials, brands, home tabs, side modules) are square 270x270 but
   carry no width/height and sit in an inline-block link that shrinks to its content: until the picture
   arrived the box was 0px wide, then rows grew by ~250px (CLS up to 0.29 on some loads, also on the old shop).
   Give the link the full column width (red.css keeps it inline-block in listings, which is fine) and reserve
   min(column width, 270px) as a centred square, the size it ends up anyway.
   Matched by the thumbnail size in the file name, so other image sizes keep their own behaviour. */
.product-image-container > a { display: block; width: 100%; }
.product-image-container > a > img[src*="-270x270."],
.product-image-container > a > img[data-src*="-270x270."] { aspect-ratio: 1 / 1; width: 100%; max-width: 270px; height: auto; margin: 0 auto; }

/* Home: the two side banners beside the slider (390x210) are lazy-loaded from a 1px placeholder, so the
   "Trending items" tabs below jumped down ~140px when they arrived (CLS 0.13). Reserve their box; a future
   banner with another shape is cropped to fit instead of stretched. */
.b-img > a > img, .b-img2 > a > img { display: block; aspect-ratio: 390 / 210; width: 100%; height: auto; object-fit: cover; }

/* Home slider: slides are resized to 950x450 and lazy-loaded from a 1px placeholder; reserve the ratio. */
.so-homeslider img[data-src*="-950x450."], .so-homeslider img[src*="-950x450."] { aspect-ratio: 950 / 450; width: 100%; height: auto; }

/* Mega-menu dropdowns as wide as on live (2026-11-17, owner's request). Live's header puts the menu in a 6/12 column
   next to login/cart/phone and every dropdown is 100% of that column; here the menu gets 10/12 of the row (so all
   items fit, see above), which made 100% far wider. From 1200px up, size the full-width dropdowns like live's column
   ((100% + 30px) x 6/10 - 30px = 60% - 12px) and start them under HOME. Below 1200px the layout is live's already. */
@media (min-width: 1200px) {
  .container-megamenu.horizontal ul.megamenu > li > .sub-menu[style*="width: 100%"] {
    width: calc(60% - 12px) !important;
    left: 0 !important;
    right: auto !important;
  }
}
