/* Mobile overrides for the 960.gs farminsieme theme.
   Everything is inside max-width:979px, so desktop (>=980px) is untouched. */
@media screen and (max-width: 979px) {

  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html, body { overflow-x: hidden; }
  body { font-size: 16px; line-height: 1.45; min-width: 0 !important; background-size: auto; }
  *, *:before, *:after { box-sizing: border-box; }

  /* ---------- grid / containers become fluid ---------- */
  .container_24, #fgl, .footer.container_24 {
    width: auto !important; max-width: 100%; margin-left: 0; margin-right: 0;
  }
  .container_24 [class*="grid_"], [class*="grid_"] {
    display: block; float: none !important; width: auto !important;
    margin-left: 0 !important; margin-right: 0 !important; left: auto; right: auto;
  }
  [class*="prefix_"] { padding-left: 0 !important; }
  [class*="suffix_"] { padding-right: 0 !important; }
  [class*="push_"], [class*="pull_"] { left: auto !important; right: auto !important; }

  /* DOM puts the left column (#ktcln) first; the header lives inside .grid_19.
     Flex + order moves the sidebar below the main content. */
  #fgl { display: flex; flex-direction: column; }
  #fgl > * { order: 1; min-width: 0; }
  #fgl > #ktcln { order: 2; margin-top: 0 !important; padding: 0 12px 16px; }
  #fgl > .clear { display: none; }

  .cocrp { margin-left: 0 !important; }
  .logo, #ktbnr { margin: 0 !important; width: auto !important; }

  /* neutralise any fixed widths / negative offsets left in theme or inline styles */
  #fgl div, #fgl ul, #fgl form, #fgl fieldset, #fgl p, #fgl h1, #fgl h2, #fgl h3,
  .footer div, .footer ul {
    max-width: 100%;
  }
  #fgl [style*="width"], .footer [style*="width"] { max-width: 100% !important; }

  /* media */
  img, iframe, video, embed, object, svg { max-width: 100% !important; height: auto; }
  iframe { width: 100%; }
  table { max-width: 100% !important; }
  #fgl table:not(.kcalendar) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; width: auto !important; }
  input, select, textarea { max-width: 100%; font-size: 16px; }

  /* ---------- content padding ---------- */
  .grid_19 > .cocrp > *:not(#ktbnr) { padding-left: 14px; padding-right: 14px; }

  /* ---------- header ---------- */
  .clw1547, .clw1550, .clw1548 { margin: 0 !important; }
  #myb .spacer, #myb .floatLeft { float: none !important; width: auto !important; }
  #myb img { display: block; width: 100%; height: auto; }
  .clw1948 { padding: 8px 14px 0; }
  .clw1948 img { position: static !important; display: block; max-width: 240px !important; margin: 0 auto; }
  .clw1948 .kblank { display: none; }

  .topnav { height: auto !important; text-align: center; padding: 8px 12px; line-height: 1.4; }
  .topnav > * { float: none !important; }
  .topnav a.signin, .topnav a.sign { display: inline-block; vertical-align: middle; margin: 4px 6px; }
  .topnav a.signin span, .topnav a.sign span { display: inline-block; min-height: 44px; line-height: 44px !important; padding: 0 14px !important; height: auto !important; }
  #signin_menu, #signin_menu_p, #signin_menu_op { right: 0 !important; left: 0 !important; width: auto !important; margin: 0 12px; }
  #signin_menu input[type=text], #signin_menu input[type=password] { width: 100% !important; }

  /* top menu: wrap into a vertical list */
  .clw1559 { margin: 0 !important; }
  .clw1559 .kms3 { width: auto !important; margin: 0 !important; }
  .clw1559 .kms3 ul { white-space: normal !important; padding: 0 !important; display: flex; flex-wrap: wrap; border-top: 1px solid #ccc; }
  .clw1559 .kms3 ul li { display: block !important; margin: 0 !important; flex: 1 1 50%; border-bottom: 1px solid #e3e3e3; }
  .clw1559 .kms3 ul li a, .clw1559 .kms3 ul li strong { display: flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 6px 10px !important; border-bottom: 0 !important; font-size: 15px; }
  .clw1559 .kblank { display: none; }

  /* generic menus: comfortable tap targets */
  .kmenu ul li, .km ul li { margin-bottom: 0 !important; }
  .kmenu ul li a, .km ul li a { display: block; min-height: 44px; padding: 11px 0; font-size: 16px; }
  .kmo .kmenu ul li, .kmc .kmenu ul li { display: inline-block; margin-right: 12px; }

  /* ---------- left column (now below content) ---------- */
  #ktcln .cls1501, #ktcln .kmv1, #ktcln [class*="clw"] { width: auto !important; margin-left: 0 !important; margin-right: 0 !important; }
  #ktcln .dcolor, #ktcln .dcolor_n { margin: 0 auto; }
  #ktcln a img { margin-left: 0; }
  .div_login_facebook, .div_login_googlep { height: auto !important; margin-bottom: 8px; }
  .div_login_facebook img, .div_login_googlep img { width: 260px !important; }
  #ktcln .km, #ktcln .km ul, #ktcln .kmenu ul { width: auto !important; }

  /* ---------- home carousel (carouFredSel sets fixed px heights inline) ---------- */
  .caroufredsel_wrapper { height: auto !important; aspect-ratio: 710 / 280; }
  .caroufred, .clw1972 .caroufred { height: auto !important; }
  /* до инициализации carouFredSel (JS теперь defer) — резервируем место под 1 слайд, без CLS */
  .clw1972 .caroufred:not(.caroufredsel_wrapper .caroufred) { aspect-ratio: 710 / 280; overflow: hidden; }
  .caroufred .item_row, .caroufred .item { height: auto !important; }
  .clw1972 .kblank { display: none; }

  /* ---------- listing boxes ---------- */
  .snkpl { float: none !important; clear: both; overflow: hidden; width: auto !important; margin-right: 0 !important; }
  .snkpl .snkplBox { height: auto !important; overflow: hidden; }
  .snkpl h2 { position: static !important; width: auto !important; height: auto !important; margin: 0 0 8px !important; padding: 8px 10px !important; line-height: 1.3 !important; }
  .snkpl .snkplImg img { margin-top: 0 !important; }
  .snkpl p { padding-top: 0 !important; }
  .clw1966 { float: none !important; margin: 0 !important; }
  .clw1942, .clw1956, .clw1974 { margin-left: 0 !important; margin-right: 0 !important; }
  #gmap { height: 300px !important; }

  /* shop product grid: two fluid columns */
  .c_pkpl_g .pkpl_g { width: calc(50% - 10px) !important; margin: 0 10px 18px 0 !important; }
  .obj_paging .pagination a, .obj_paging a { display: inline-block; min-width: 40px; min-height: 40px; line-height: 40px; text-align: center; }

  /* breadcrumb */
  .clw1551 { padding: 0 14px; }
  .clw1551 .bc { font-size: 14px; }

  /* ---------- footer ---------- */
  .footer .ft { margin: 0 !important; padding: 20px 14px; }
  .footer .separator { margin-left: 0; margin-right: 0; }
  .footer .floatLeft { float: none !important; width: auto !important; }
  .footer .kmenu { margin: 0 !important; }
  .footer .kmenu ul li { display: inline-block; margin: 0 14px 0 0 !important; }
  .footer .kmenu ul li a { display: inline-block; min-height: 44px; line-height: 22px; padding: 11px 0; }
  .footer h6, .footer .kpar { font-size: 12px; line-height: 1.4; }

  /* floating social icons: put them in the flow at the bottom */
  .pnl { position: static !important; display: flex; justify-content: center; gap: 16px; padding: 12px 0 90px; }
  .pnl a { margin: 0 !important; }

  /* ---------- cookie banner: compact strip at the bottom ---------- */
  .cc_banner.cc_container { max-height: 40vh; overflow-y: auto; padding: 10px 14px !important; font-size: 13px !important; line-height: 1.35 !important; }
  .cc_banner .cc_message { font-size: 13px !important; line-height: 1.35 !important; margin: 0 0 8px !important; padding: 0 !important; }
  .cc_banner .cc_btn { float: none !important; display: block; width: 100% !important; max-width: none !important; min-height: 44px; line-height: 24px; padding: 10px !important; font-size: 15px !important; margin: 0 !important; }
}

@media screen and (max-width: 600px) {
  /* CMS "spacer" rows (inline % widths) stack on phones */
  #fgl .spacer > .floatLeft { float: none !important; width: auto !important; }
  .clw1559 .kms3 ul li a, .clw1559 .kms3 ul li strong { font-size: 14px; }
}

/* ---------- блок «Altri prodotti» (восстановленные товары) ---------- */
.correlati { clear: both; margin: 10px 0 20px; }
.correlati .correlati-list { margin: 8px 0 0; padding: 0 0 0 18px; columns: 2; column-gap: 24px; }
.correlati .correlati-list li { margin: 0 0 6px; break-inside: avoid; }
@media screen and (max-width: 600px) {
  .correlati .correlati-list { columns: 1; }
  .correlati .correlati-list a { display: inline-block; min-height: 44px; line-height: 44px; }
}
