/* =============================================
   iPad / Tablet Garson Arayuzu - AdisyonGo
   Target: 768px - 1199px (iPad portrait & landscape)
   Masaustu (1200px+) etkilenmez
   ============================================= */

/* ------------------------------------------
   0. GENEL TOUCH / iPAD
   ------------------------------------------ */
@media (max-width: 1199px) {
  input, select, textarea {
    font-size: 16px !important;
  }
  .overflow-y-auto,
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* ------------------------------------------
   BOTTOM TAB BAR (Tablet POS)
   ------------------------------------------ */
/* Default: gizli (desktop) */
#pos-bottom-tabs {
  display: none !important;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #1f2937;
  border-top: 1px solid #374151;
  padding: 0;
  height: 64px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.pos-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 64px;
  position: relative;
}
.pos-tab-btn.active {
  color: #60a5fa;
}
.pos-tab-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: #60a5fa;
  border-radius: 0 0 3px 3px;
}
.pos-tab-btn.pay-btn {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border-radius: 0;
  font-weight: 700;
  font-size: 13px;
}
.pos-tab-btn.pay-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #047857, #059669);
}
.pos-tab-btn.pay-btn.active::after {
  background: #34d399;
}
.pos-tab-btn svg {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------
   1. LOGIN SAYFASI
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {
  .sm\:max-w-md {
    max-width: 540px !important;
  }
  .min-h-screen.flex.flex-col {
    padding: 2rem 1.5rem !important;
  }
  .app-logo img {
    height: 3rem !important;
  }
  .app-logo {
    font-size: 1.5rem !important;
  }
  .sm\:max-w-md input[type="email"],
  .sm\:max-w-md input[type="password"],
  .sm\:max-w-md .block.mt-1.w-full {
    min-height: 52px !important;
    font-size: 17px !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
  }
  .sm\:max-w-md label {
    font-size: 15px !important;
    font-weight: 600 !important;
  }
  .sm\:max-w-md button[type="submit"],
  .sm\:max-w-md .button {
    min-height: 52px !important;
    font-size: 17px !important;
    padding: 12px 32px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
  }
  .sm\:max-w-md input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
  }
  .sm\:max-w-md .mt-4 {
    margin-top: 1.5rem !important;
  }
  .sm\:max-w-md a {
    font-size: 15px !important;
  }
}

/* ------------------------------------------
   2. POS - ANA LAYOUT (EN KRITIK)
   Tablet'te yan yana, viewport'a sigacak
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {

  /* Ana container: dikey layout, tab-based navigation */
  #pos-container {
    display: block !important;
    height: calc(100vh - 56px - 64px) !important; /* navbar + bottom tabs */
    overflow: hidden !important;
  }

  /* Menu section: full width, scrollable */
  #pos-menu-section {
    width: 100% !important;
    height: calc(100vh - 56px - 64px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Order section: full width, scrollable */
  #pos-order-section {
    width: 100% !important;
    height: calc(100vh - 56px - 64px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Siparis paneli full width */
  .lg\:w-6\/12.flex.flex-col {
    width: 100% !important;
    max-width: 100% !important;
    min-height: unset !important;
    border-left: none !important;
  }

  /* min-h-screen kaldir */
  .lg\:w-6\/12.min-h-screen {
    min-height: unset !important;
  }

  /* Menu inner container */
  .md\:flex.flex-col.bg-gray-50 {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }

  /* Menu items scrollable */
  .md\:flex.flex-col.bg-gray-50 > .mt-4:last-child {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
  }

  /* Bottom tabs GORUNUR - tablet */
  #pos-bottom-tabs {
    display: flex !important;
  }

  /* Mobile menu toggle gizle - bottom tabs yerine */
  .fixed.bottom-6.right-6.z-50.md\:hidden {
    display: none !important;
  }

  /* Menu panel her zaman gorunur (Alpine.js hidden override) */
  [x-data] .md\:flex.flex-col.bg-gray-50 {
    display: flex !important;
  }

  /* Body padding for bottom tabs */
  body {
    padding-bottom: 64px !important;
  }
}

/* ------------------------------------------
   3. POS MENU PANELI DETAY
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {

  /* Arama + Reset kompakt */
  .bg-gray-50 .flex.items-center.justify-between.gap-3 {
    gap: 8px !important;
  }
  .bg-gray-50 input[type="text"] {
    min-height: 40px !important;
    font-size: 14px !important;
  }

  /* Kategori butonlari - tek satir scroll */
  .flex.gap-2.mt-4 button,
  .flex.gap-2.overflow-x-auto button {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    min-height: 34px !important;
    white-space: nowrap !important;
  }
  .flex.gap-2.mt-4.overflow-x-auto,
  .flex.gap-2.overflow-x-auto {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
    margin-top: 8px !important;
  }

  /* Menu items grid - 4 sutun (full width panel) */
  .grid.grid-cols-2.md\:grid-cols-3 {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }

  /* Menu item isim */
  .grid.grid-cols-2 h5,
  .grid.grid-cols-2.md\:grid-cols-3 h5 {
    font-size: 12px !important;
    min-height: auto !important;
    line-height: 1.3 !important;
  }

  /* Menu item fiyat */
  .grid.grid-cols-2 .text-base.font-semibold,
  .grid.grid-cols-2.md\:grid-cols-3 .text-base.font-semibold {
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  /* Resim gizle - yer kazanmak icin */
  .grid.grid-cols-2 .aspect-square,
  .grid.grid-cols-2.md\:grid-cols-3 .aspect-square,
  .grid.grid-cols-2 .hidden.md\:block,
  .grid.grid-cols-2.md\:grid-cols-3 .hidden.md\:block {
    display: none !important;
  }

  /* Item padding kompakt */
  .grid.grid-cols-2 .p-2,
  .grid.grid-cols-2.md\:grid-cols-3 .p-2 {
    padding: 6px !important;
  }
}

/* ------------------------------------------
   4. POS SIPARIS PANELI DETAY
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {

  /* Panel padding kompakt */
  .lg\:w-6\/12.flex.flex-col {
    padding: 10px 12px !important;
  }

  /* Order type butonlari - tek satir, genis */
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 > div {
    min-height: 48px !important;
    border-radius: 10px !important;
  }
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 label {
    font-size: 15px !important;
    padding: 8px 6px !important;
  }

  /* Siparis paneli icerik padding */
  .lg\:w-6\/12.flex.flex-col {
    padding: 16px 20px !important;
  }

  /* Siparis header alani */
  .lg\:w-6\/12 .mb-4 {
    margin-bottom: 10px !important;
  }

  /* Select, input buyuk (full-width panel) */
  .lg\:w-6\/12 select {
    min-height: 44px !important;
    font-size: 15px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
  }
  .lg\:w-6\/12 input[type="number"] {
    min-height: 44px !important;
    font-size: 16px !important;
    width: 56px !important;
  }

  /* Siparis item tablo - buyuk ve okunaklı */
  .lg\:w-6\/12 table td,
  .lg\:w-6\/12 table th {
    padding: 10px 8px !important;
    font-size: 14px !important;
  }

  /* Adet butonlari (+ / -) buyuk */
  .lg\:w-6\/12 .inline-flex button {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px !important;
  }

  /* Toplam alani */
  .lg\:w-6\/12 .border-t {
    padding-top: 12px !important;
    margin-top: 8px !important;
  }

  /* FATURA / Odeme butonlari - COKBUYUK */
  .lg\:w-6\/12 .grid.grid-cols-2 > button,
  .lg\:w-6\/12 .grid.grid-cols-2 > a {
    min-height: 56px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
  }
}

/* ------------------------------------------
   5. MASA GORUNUMU
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {
  .text-xl.font-semibold,
  .sm\:text-2xl {
    font-size: 1.5rem !important;
  }
  .inline-flex.rounded-lg.shadow-sm button {
    padding: 10px 16px !important;
    font-size: 14px !important;
    min-height: 44px !important;
  }
  .f-15.font-medium {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
  }
  .sm\:grid-cols-3.lg\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
  }
  .sm\:grid-cols-3.lg\:grid-cols-4 > div,
  .sm\:grid-cols-3.lg\:grid-cols-4 > a {
    min-height: 100px !important;
  }
  .p-2.rounded-lg.tracking-wide h3,
  .p-2.rounded-md.tracking-wide h3 {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
  }
  .p-2.rounded-lg.tracking-wide,
  .p-2.rounded-md.tracking-wide {
    padding: 10px 16px !important;
    border-radius: 10px !important;
  }
  .text-xs.font-medium.text-gray-500 {
    font-size: 13px !important;
  }
}

/* ------------------------------------------
   6. SET-TABLE MODAL
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {
  .sm\:max-w-2xl {
    max-width: 90vw !important;
  }
  .grid.sm\:grid-cols-3 {
    gap: 12px !important;
  }
  .grid.sm\:grid-cols-3 > a {
    min-height: 80px !important;
  }
  .grid.sm\:grid-cols-3 h3 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
  }
}

/* ------------------------------------------
   7. SIDEBAR - Tablet overlay
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {
  #sidebar {
    position: fixed !important;
    z-index: 50 !important;
    height: 100vh !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15) !important;
  }
  .flex-grow {
    width: 100% !important;
  }
}

/* ------------------------------------------
   8. DIALOG / MODAL
   ------------------------------------------ */
@media (min-width: 768px) and (max-width: 1199px) {
  [x-data] [role="dialog"] input,
  [x-data] [role="dialog"] select,
  [x-data] [role="dialog"] textarea {
    min-height: 44px !important;
    font-size: 16px !important;
  }
  [x-data] [role="dialog"] button {
    min-height: 44px !important;
    padding: 10px 20px !important;
    font-size: 15px !important;
  }
}
