/* ============================================================
   responsive.css — 768px altı breakpoint kuralları
   Amazon Affiliate ROI Aracı
   ============================================================ */

/* ─── Tablet / Small Desktop (max 1024px) ──────────────────── */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }

  .detail-panel {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* ─── Mobile Breakpoint (max 768px) ────────────────────────── */
@media (max-width: 768px) {

  /* ── Layout ─────────────────────────────────────────────── */
  .app-body {
    flex-direction: column;
    overflow: visible;
  }

  .app-main {
    padding: 12px;
    gap: 12px;
  }

  /* ── Header ─────────────────────────────────────────────── */
  .app-header {
    padding: 0 12px;
    gap: 10px;
  }

  .app-header__meta {
    display: none; /* hide upload meta on small screens */
  }

  /* ── Sidebar — overlay behaviour ────────────────────────── */
  .app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(var(--sidebar-width), 90vw);
    height: 100%;
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow-md);
    /* override sticky from main.css */
    top: 0;
  }

  .app-sidebar.sidebar--open {
    transform: translateX(0);
  }

  /* Backdrop overlay (created via JS when sidebar opens) */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 299;
  }

  .sidebar-backdrop.visible {
    display: block;
  }

  /* Show the close/toggle button inside panel header */
  .panel-header__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }


  /* ── Upload Zone ─────────────────────────────────────────── */
  .upload-zone {
    min-height: 140px;  /* reduced on mobile */
    padding: 20px 16px;
    gap: 8px;
  }

  .upload-zone__icon {
    width: 36px;
    height: 36px;
  }

  .upload-zone__title {
    font-size: 0.9rem;
  }

  /* ── Filter Bar ─────────────────────────────────────────── */
  .filter-bar {
    padding: 10px 12px;
    gap: 8px;
  }

  .filter-bar__input {
    flex: 1;
    min-width: 60px;
  }

  /* ── Table — horizontal scroll ──────────────────────────── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  /* Keep table min-width so columns don't collapse */
  .product-table {
    min-width: 700px;
  }

  /* Reduce cell padding on mobile */
  .product-table th,
  .product-table td {
    padding: 8px 6px;
  }

  /* ── Detail Panel ───────────────────────────────────────── */
  .detail-panel {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
  }

  /* ── Market Tabs ────────────────────────────────────────── */
  .market-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .market-tab {
    flex-shrink: 0;
  }

  /* ── Control Panel Row (Mobile) ─────────────────────────── */
  .control-panel-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .control-panel-divider {
    display: none;
  }

  /* ── Toast position ─────────────────────────────────────── */
  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
  }

  /* ── Panel footer full-width buttons ────────────────────── */
  .panel-footer__secondary {
    flex-direction: column;
  }

  .panel-footer__secondary .btn {
    flex: none;
  }
}

/* ─── Very small phones (max 480px) ────────────────────────── */
@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .app-header__logo span {
    display: none; /* show only icon on very small screens */
  }

  .upload-zone {
    min-height: 120px;
  }

  .detail-panel {
    grid-template-columns: 1fr;
  }

  /* Stack market tabs two-per-row */
  .market-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    flex-wrap: unset;
  }

  .market-tab {
    flex-shrink: unset;
    justify-content: center;
  }
}


