/* =========================================================
   MANUS MACHINES LIBRARY — mml-* PREFIX SYSTEM
   Desktop + Laptop + Mobile (ayrı HTML blokları)
   ========================================================= */

/* ── GİZLEME KURALLARI ── */
@media (max-width: 900px) {
  .mml-desktop { display: none !important; }
}
@media (min-width: 901px) {
  .mml-mobile { display: none !important; }
}

/* =========================================================
   SECTION & CONTAINER
   ========================================================= */
#mml-section {
  padding: 60px 0;
  width: 100% !important;
  max-width: 100% !important;
}

#mml-section > .elementor-container,
#mml-section .elementor-container,
#mml-section .elementor-column,
#mml-section .elementor-widget-wrap,
#mml-section .elementor-element-populated {
  max-width: 1600px !important;
  width: 100% !important;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.elementor-section#mml-section,
section#mml-section {
  max-width: 100% !important;
  width: 100% !important;
}

/* =========================================================
   DESKTOP — HEADING
   ========================================================= */
.mml-heading {
  text-align: center;
  margin-bottom: 30px;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.mml-heading h2 {
  font-size: 90px;
  margin: 0;
  color: #1c1c1c !important;
  text-align: center;
}

#mml-main-title {
  font-size: 90px;
  text-align: center;
}

#mml-brand-title {
  font-size: 35px;
  text-align: center;
  margin-bottom: 20px;
}

/* =========================================================
   DESKTOP — CLICK HINT
   ========================================================= */
.mml-click-hint {
  text-align: center;
  color: #ff7200;
  font-size: 20px;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 15px;
}

/* =========================================================
   DESKTOP — WRAPPER (sidebar + content)
   ========================================================= */
.mml-wrapper {
  display: block;
  max-width: 1600px !important;
  margin: 0 auto;
  width: 100% !important;
  padding: 0 20px;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
  min-height: 500px;
}

/* =========================================================
   DESKTOP — HINT POPUP (floating)
   ========================================================= */
.mml-hint-popup {
  position: absolute;
  top: 80px;
  right: 40px;
  background: linear-gradient(135deg, #ff7200 0%, #e06500 100%);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(255, 114, 0, 0.4);
  z-index: 999999;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mml-hint-popup.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mml-hint-popup::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 30px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #e06500;
}

/* =========================================================
   DESKTOP — SIDEBAR
   ========================================================= */
.mml-sidebar {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px; /* same as wrapper padding-left */
  width: 280px;
}

.mml-brand-nav {
  flex: 1;
  min-height: 0;
  width: 280px;
  border: 1px solid #ececec !important;
  border-radius: 12px !important;
  padding: 12px 0;
  background: #fff !important;
  overflow-y: auto !important;
  scrollbar-width: auto !important;
  scrollbar-color: #ff7200 #ffe6d1 !important;
}

.mml-brand-nav::-webkit-scrollbar {
  width: 16px !important;
}

.mml-brand-nav::-webkit-scrollbar-track {
  background: #ffe6d1 !important;
  border-radius: 999px !important;
}

.mml-brand-nav::-webkit-scrollbar-thumb {
  background: #ff7200 !important;
  border-radius: 999px !important;
  border: 3px solid #ffe6d1 !important;
}

/* ── Brand Buttons ── */
.mml-brand-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  cursor: pointer;
  color: #000 !important;
  border-left: 4px solid transparent;
  text-decoration: none;
  transition: all 0.2s ease;
  background: #fff !important;
  border: none;
  font-size: 20px;
  border-radius: 0;
}

.mml-brand-btn:hover,
.mml-brand-btn:focus-visible {
  background: #ffe6d1 !important;
  color: #d85d00 !important;
}

.mml-brand-btn.active {
  border-left-color: #ff7200 !important;
  background: #ff7200 !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
}

/* ── Nav Section Headers ── */
.mml-nav-header {
  padding: 12px 20px;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ff7200;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #ececec;
  margin-bottom: 4px;
  background: #fff8f3;
}

/* ── Brand Badge ── */
.mml-brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff7200;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 14px;
  margin-left: 8px;
}

.mml-brand-btn.active .mml-brand-badge {
  background: rgba(255, 255, 255, 0.3);
}

/* ── Total Count ── */
.mml-total-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #ff7200 0%, #e06500 100%);
  border-radius: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 114, 0, 0.3);
  width: 280px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.mml-total-count .total-number {
  font-size: 28px;
  font-weight: 800;
}

/* =========================================================
   DESKTOP — CONTENT AREA
   ========================================================= */
.mml-content {
  margin-left: 304px; /* 280px width + 24px gap */
  width: calc(100% - 304px);
  border: 1px solid #ececec !important;
  border-radius: 12px;
  padding: 24px;
  background: #fff !important;
  overflow: hidden;
  box-sizing: border-box;
}

/* ── Count Center ── */
.mml-count-center {
  text-align: center;
  margin-bottom: 8px;
}

.mml-count-center .count-badge {
  background: #ff7200;
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 600;
  display: inline-block;
}

/* =========================================================
   DESKTOP — GRID (horizontal scroll, 3 rows)
   ========================================================= */
.mml-grid {
  display: grid;
  grid-template-rows: repeat(3, min-content);
  grid-auto-flow: column;
  grid-auto-columns: 260px;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  transform: rotateX(180deg);
  scroll-behavior: auto !important;
  scrollbar-width: auto;
  scrollbar-color: #ff7200 #ffe6d1;
  align-items: start;
  cursor: grab;
  user-select: none;
}

.mml-grid.active {
  cursor: grabbing;
}

.mml-grid.active .mml-card {
  transform: rotateX(180deg) scale(1) !important;
}

.mml-grid::-webkit-scrollbar {
  height: 16px !important;
}

.mml-grid::-webkit-scrollbar-track {
  background: #ffe6d1 !important;
  border-radius: 999px !important;
}

.mml-grid::-webkit-scrollbar-thumb {
  background: #ff7200 !important;
  border-radius: 999px !important;
  border: 3px solid #ffe6d1 !important;
}

/* =========================================================
   DESKTOP — CARDS
   ========================================================= */
.mml-card {
  border: 1px solid #eee !important;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa !important;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  width: 100%;
  height: 100%;
  position: relative;
  transform: rotateX(180deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.mml-card:hover {
  transform: rotateX(180deg) scale(1.03);
  box-shadow: 0 8px 30px rgba(255, 114, 0, 0.35), 0 0 0 2px #ff7200 !important;
  z-index: 5;
  border-color: #ff7200 !important;
}

.mml-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #fff !important;
  display: block;
  padding: 0;
  -webkit-user-drag: none;
}

.mml-card-fallback {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0 !important;
  color: #999 !important;
  font-size: 20px;
}

.mml-card-visual {
  position: relative;
  width: 100%;
  display: block;
}

/* ── Strips ── */
.mml-strip-brand {
  background-color: #ff7200 !important;
  width: 100%;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  clip-path: polygon(40px 0, 100% 0, 100% 100%, 20px 100%);
  position: absolute;
  bottom: 28px;
  left: 0;
  z-index: 10;
  margin-top: 0;
}

.mml-strip-model {
  background-color: #000 !important;
  width: 100%;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 10;
}

.mml-card-brand {
  font-size: 13px;
  text-transform: uppercase;
  color: #fff !important;
  letter-spacing: 0.04em;
  margin: 0;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mml-card-model {
  font-size: 15px;
  font-weight: 600;
  color: #fff !important;
  margin: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Utility ── */
.mml-hidden {
  display: none !important;
}

.mml-empty {
  padding: 20px;
  border: 1px solid #ffd7ba !important;
  border-radius: 10px;
  background: #fff6ef !important;
  color: #8a4f10 !important;
  text-align: center;
  font-size: 20px;
}

/* =========================================================
   MODAL (Masaüstü + Mobil ortak)
   ========================================================= */
.mml-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.mml-modal-overlay.mml-open {
  opacity: 1;
  visibility: visible;
}

.mml-modal-body {
  background: #fff;
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  padding: 40px 30px;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.mml-modal-overlay.mml-open .mml-modal-body {
  transform: translateY(0) scale(1);
}

.mml-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #f0f0f0 !important;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  color: #333 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mml-modal-close:hover {
  background: #ff7200 !important;
  color: #fff !important;
}

.mml-modal-img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  margin-bottom: 24px;
  background: #fafafa;
  border-radius: 8px;
  padding: 10px;
}

.mml-modal-brand {
  font-size: 20px;
  color: #ff7200;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.mml-modal-title {
  font-size: 35px;
  font-weight: 800;
  margin: 0 0 20px 0;
  color: #1c1c1c;
}

.mml-modal-text {
  font-size: 20px;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.5;
}

.mml-modal-btn {
  display: inline-block;
  background: #ff7200;
  color: #fff !important;
  padding: 16px 40px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 114, 0, 0.3);
}

.mml-modal-btn:hover {
  background: #e06500;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 114, 0, 0.4);
}

/* =========================================================
   LAPTOP — BÜYÜK (1025px – 1440px)
   ========================================================= */
@media screen and (min-width: 1025px) and (max-width: 1440px) {
  #mml-section > .elementor-container,
  #mml-section .elementor-container,
  #mml-section .elementor-column,
  #mml-section .elementor-widget-wrap,
  #mml-section .elementor-element-populated {
    max-width: 95% !important;
  }

  .mml-heading { max-width: 95%; }
  #mml-main-title { font-size: 60px; }
  .mml-brand-title { font-size: 30px; }
  .mml-wrapper { max-width: 95% !important; display: block; }

  .mml-sidebar { width: 220px; position: absolute; left: 20px; top: 0; bottom: 0; }
  .mml-brand-nav { width: 220px; }
  .mml-total-count { width: 220px; }
  .mml-content { margin-left: 240px; width: calc(100% - 240px); max-width: none; padding: 16px; box-sizing: border-box; }

  .mml-grid { grid-auto-columns: calc(25% - 12px); gap: 16px; padding: 16px 20px; }
  .mml-card img { height: 160px; }
  .mml-card-fallback { height: 160px; }
}

/* =========================================================
   LAPTOP — KÜÇÜK (901px – 1024px)
   ========================================================= */
@media screen and (min-width: 901px) and (max-width: 1024px) {
  #mml-section { padding: 30px 0; }

  #mml-section > .elementor-container,
  #mml-section .elementor-container,
  #mml-section .elementor-column,
  #mml-section .elementor-widget-wrap,
  #mml-section .elementor-element-populated {
    max-width: 100% !important;
  }

  .mml-heading { max-width: 100%; }
  #mml-main-title { font-size: 46px; }
  .mml-brand-title { font-size: 26px; }
  .mml-wrapper { max-width: 100% !important; display: block; }

  .mml-sidebar { width: 200px; position: absolute; left: 20px; top: 0; bottom: 0; }
  .mml-brand-nav { width: 200px; }
  .mml-total-count { width: 200px; }
  .mml-content { margin-left: 216px; width: calc(100% - 216px); max-width: none; padding: 12px; box-sizing: border-box; }

  .mml-grid { grid-auto-columns: calc(33.333% - 8px); gap: 12px; padding: 12px 16px; }
  .mml-card img { height: 140px; }
  .mml-card-fallback { height: 140px; }
}

/* =========================================================
   MOBİL LAYOUT (≤900px) — Tamamen bağımsız HTML bloğu
   ========================================================= */
@media screen and (max-width: 900px) {

  #mml-section {
    padding: 12px 0 !important;
    overflow: hidden;
  }

  #mml-section > .elementor-container,
  #mml-section .elementor-container,
  #mml-section .elementor-column,
  #mml-section .elementor-widget-wrap,
  #mml-section .elementor-element-populated {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .mml-mobile {
    width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .mml-mob-heading {
    text-align: center;
    padding: 0 8px;
    margin-bottom: 8px;
  }

  .mml-mob-title {
    font-size: 56px;
    font-weight: 700;
    color: #1c1c1c !important;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
  }

  .mml-mob-title .mml-mob-title-accent {
    color: #ff7200 !important;
  }

  .mml-mob-total {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0 8px 12px;
    background: linear-gradient(135deg, #ff7200 0%, #e06500 100%) !important;
    border-radius: 8px;
    color: #fff !important;
    font-size: 20px;
    font-weight: 600;
  }

  .mml-mob-total .total-number {
    font-size: 24px;
    font-weight: 800;
  }

  .mml-mob-brands {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 6px 8px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mml-mob-brands::-webkit-scrollbar {
    display: none;
  }

  .mml-mob-brand-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
    background: #fff !important;
    border: 1px solid #ececec !important;
    border-radius: 8px;
    color: #333 !important;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
  }

  .mml-mob-brand-btn:hover {
    background: #ffe6d1 !important;
    color: #d85d00 !important;
  }

  .mml-mob-brand-btn.active {
    background: #ff7200 !important;
    color: #fff !important;
    border-color: #ff7200 !important;
  }

  .mml-mob-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff7200 !important;
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    border-radius: 12px;
  }

  .mml-mob-brand-btn.active .mml-mob-brand-badge {
    background: rgba(255, 255, 255, 0.35) !important;
  }

  .mml-mob-content {
    border: 1px solid #ececec !important;
    border-radius: 8px;
    padding: 12px;
    background: #fff !important;
    overflow: hidden;
  }

  .mml-mob-brand-name {
    font-size: 26px;
    font-weight: 700;
    color: #1c1c1c !important;
    text-align: center;
    margin: 0 0 8px;
  }

  .mml-mob-count {
    text-align: center;
    margin-bottom: 8px;
  }

  .mml-mob-count .count-badge {
    background: #ff7200 !important;
    color: #fff !important;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 20px;
    font-weight: 600;
    display: inline-block;
  }

  .mml-mob-hint {
    text-align: center;
    color: #ff7200 !important;
    font-size: 20px;
    font-weight: 600;
    margin: 6px 0 10px;
  }

  .mml-mob-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 800px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ff7200 #f0f0f0 !important;
  }

  .mml-mob-grid::-webkit-scrollbar {
    width: 4px;
  }

  .mml-mob-grid::-webkit-scrollbar-thumb {
    background: #ff7200 !important;
    border-radius: 4px;
  }

  .mml-mob-grid::-webkit-scrollbar-track {
    background: #f0f0f0 !important;
  }

  .mml-mob-card {
    flex: 0 0 calc(50% - 4px);
    width: calc(50% - 4px);
    border: 1px solid #eee !important;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa !important;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.2s;
  }

  .mml-mob-card:active {
    border-color: #ff7200 !important;
  }

  .mml-mob-card-visual {
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .mml-mob-card img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    background: #fff !important;
    display: block;
    margin-bottom: auto; /* Pushes text to the bottom if cards vary in height */
  }

  .mml-mob-card-fallback {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0 !important;
    color: #999 !important;
    font-size: 20px;
  }

  .mml-mob-strip-brand {
    background-color: #ff7200 !important;
    width: 100%;
    padding: 6px 8px;
    text-align: center;
  }

  .mml-mob-strip-model {
    background-color: #000 !important;
    width: 100%;
    padding: 6px 8px;
    text-align: center;
  }

  .mml-mob-card-brand {
    font-size: 20px;
    text-transform: uppercase;
    color: #fff !important;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mml-mob-card-model {
    font-size: 20px;
    font-weight: 600;
    color: #fff !important;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mml-mob-empty {
    padding: 16px;
    border: 1px solid #ffd7ba !important;
    border-radius: 8px;
    background: #fff6ef !important;
    color: #8a4f10 !important;
    text-align: center;
    font-size: 20px;
  }

  /* ── Modal Mobil Override ── */
  .mml-modal-body {
    width: 95% !important;
    max-width: 95% !important;
    padding: 24px 16px !important;
    border-radius: 12px !important;
  }

  .mml-modal-img {
    height: 160px !important;
    margin-bottom: 12px !important;
    padding: 4px !important;
  }

  .mml-modal-title {
    font-size: 24px !important;
    margin-bottom: 8px !important;
  }

  .mml-modal-brand {
    font-size: 20px !important;
  }

  .mml-modal-text {
    font-size: 20px !important;
    margin-bottom: 16px !important;
  }

  .mml-modal-btn {
    padding: 12px 24px !important;
    font-size: 20px !important;
  }

  .mml-modal-close {
    width: 32px !important;
    height: 32px !important;
    font-size: 20px !important;
    top: 8px !important;
    right: 8px !important;
  }
}

/* ── 480px ve altı ── */
@media screen and (max-width: 480px) {
  /* .mml-mob-title { font-size: 56px; }  Already handled earlier */

  .mml-mob-grid {
    max-height: 600px;
    gap: 6px;
  }

  .mml-mob-card {
    flex: 0 0 calc(50% - 3px);
    width: calc(50% - 3px);
  }

  .mml-mob-card img { height: 110px; }
  .mml-mob-card-fallback { height: 110px; }
  .mml-mob-card-brand { font-size: 16px; }
  .mml-mob-card-model { font-size: 16px; }

  .mml-mob-brand-btn {
    padding: 6px 10px;
    font-size: 18px;
  }

  .mml-mob-brand-badge {
    min-width: 20px;
    height: 20px;
    font-size: 14px;
  }
}
