/* ================= Telefona & tableta (Android / iPhone) ================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
a, button, input, select, textarea, label { touch-action: manipulation; }
/* iPhone zmadhon faqen kur fusha ka shkronja nën 16px */
input, select, textarea { font-size: 16px; }
.table-wrap { -webkit-overflow-scrolling: touch; }
body.no-scroll { overflow: hidden; }
/* Kolonat e grid-it nuk zgjerohen nga tabelat e gjera: tabelat rrëshqasin brenda tyre */
.dash-grid > *, .pos > *, .stats > *, .row > *, .row3 > *, .shop > *, .cart-layout > *, .account > *, .contact-grid > *, .pd > * { min-width: 0; }
.bars { overflow-x: auto; }
.bars .b { min-width: 16px; }

/* ---------- Butoni burger ---------- */
.burger { display: none; width: 46px; height: 46px; flex-shrink: 0; border: 0; background: var(--blush); border-radius: 10px; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; }
.burger span { display: block; width: 22px; height: 2px; background: var(--primary); border-radius: 2px; transition: transform .25s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Menuja anësore (drawer) ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(43, 26, 48, .5); z-index: 300; opacity: 0; transition: opacity .25s; }
.drawer-bg.show { opacity: 1; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 340px); height: 100vh; height: 100dvh; z-index: 310; background: var(--paper);
  transform: translateX(-102%); transition: transform .28s ease; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  box-shadow: 8px 0 30px rgba(0, 0, 0, .18); visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.drawer-head .brand b { font-size: 22px; }
.drawer-head .brand small { display: none; }
.drawer-x { border: 0; background: var(--soft); border-radius: 8px; padding: 10px 12px; font-family: var(--font); font-size: 15px; cursor: pointer; color: var(--text); }
.drawer .search { margin-bottom: 14px; }
.drawer-nav a, .drawer-sec nav a { display: flex; justify-content: space-between; align-items: center; padding: 13px 4px; font-size: 18px; border-bottom: 1px solid var(--rule); min-height: 48px; }
.drawer-nav a.sale { color: var(--primary); font-weight: 700; }
.drawer-nav a::after, .drawer-sec nav a::after { content: "›"; color: var(--gold-dark); font-size: 22px; line-height: 1; }
.drawer-sec { margin-top: 20px; }
.drawer-sec h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--gold-dark); margin: 0 0 4px; }
.drawer-sec nav a { font-size: 17px; }
.drawer-contact { margin-top: 22px; padding: 16px; background: var(--soft); border-radius: var(--radius); display: grid; gap: 8px; font-size: 16px; }
.drawer-contact a { color: var(--primary); }
.filters-toggle { display: none; }

/* ================= Tableta dhe telefona ================= */
@media (max-width: 860px) {
  .burger { display: flex; }

  /* Koka: burger | logo | shporta */
  header.site { box-shadow: 0 2px 10px rgba(43, 26, 48, .06); }
  .bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 0 8px; flex-wrap: nowrap; }
  .brand { min-width: 0; gap: 10px; }
  .brand b { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand small { display: none; }
  .brand-mark { width: 40px; height: 40px; font-size: 22px; flex-shrink: 0; }
  .mainlinks, #accountBtn, .acct a.hide-sm { display: none; }
  .acct { margin-left: 0; gap: 8px; }
  .acct .cart { padding: 10px 12px; white-space: nowrap; font-size: 15px; }
  .acct .cart .ct { display: none; }
  .bar2 { padding-bottom: 10px; }
  .bar2 .catmenu, .bar2 .pill-btn { display: none; }
  .bar2 .search { flex-basis: 100%; }
  .search input { min-width: 0; }
  .topstrip .container { justify-content: center; text-align: center; }
  .topstrip .contact { display: none; }
  #stripText { font-size: 12px; }

  main { padding: 18px 0 40px; }

  /* Faqja kryesore */
  .banner { min-height: 0; }
  .banner::before { inset: 8px; }
  .banner-text { padding: 34px 26px; }
  .banner h1 { font-size: 34px; }
  .banner p { font-size: 17px; margin-bottom: 20px; }
  .dots { left: 26px; bottom: 14px; }
  .tiles { gap: 12px; }
  .tile { padding: 24px 22px; min-height: 0; }
  .tile h3 { font-size: 24px; }
  .perks { margin: 24px 0 30px; }
  .section-head h2 { font-size: 24px; }
  .brands-strip { gap: 20px; margin-bottom: 30px; }
  .brands-strip a { font-size: 18px; }

  /* Lista e produkteve: filtrat palosen */
  .filters-toggle { display: flex; }
  .shop { gap: 14px; }
  .shop .filters:not(.open) { display: none; }
  .toolbar h2 { font-size: 26px; }

  /* Faqja e produktit */
  .pd { gap: 20px; padding-top: 0; }
  .pd h1 { font-size: 28px; }
  .pd .price { font-size: 30px; }
  .buy .btn { flex: 1 1 auto; }

  /* Llogaria: menuja bëhet shirit horizontal */
  .side-nav { padding: 12px; }
  .side-nav .user-box { margin-bottom: 8px; }
  .account .side-nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .account .side-nav .user-box { flex-basis: 100%; }
  .account .side-nav a, .account .side-nav button { width: auto; border: 1px solid var(--rule); border-radius: 20px; padding: 8px 14px; font-size: 15px; background: #fff; }

  footer.site { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

  /* ---------- Paneli i adminit ---------- */
  .adm-mtop { display: flex; }
  .admin-body { display: block; }
  .admin-side { position: fixed; top: 0; left: 0; bottom: 0; width: min(84vw, 300px); height: 100vh; height: 100dvh; z-index: 410;
    transform: translateX(-102%); transition: transform .28s ease; overflow-y: auto; overscroll-behavior: contain; visibility: hidden;
    padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .admin-side.open { transform: none; visibility: visible; }
  .admin-side nav { display: block; overflow: visible; }
  .admin-side nav a { white-space: normal; padding: 13px 12px; font-size: 17px; }
  .admin-side .foot { display: block; }
  .adm-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 405; }
  .admin-main { padding: 14px 12px calc(30px + env(safe-area-inset-bottom)); }
  .admin-top h1 { font-size: 28px; }
  .admin-top > div, .admin-top > .btn { width: 100%; }
  .admin-top > div .btn, .admin-top > .btn { flex: 1 1 auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 22px; }
  .admin-main .panel { padding: 14px; }
  .admin-main .panel > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }
  .filters-bar input, .filters-bar select { min-width: 0; flex: 1 1 140px; }
  .pos-mode .admin-main { padding: 10px; }
  .pos { gap: 10px; }
  .pos-top input { font-size: 18px; padding: 12px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 46vh; }
  .pos-cats { flex-wrap: nowrap; overflow-x: auto; }
  .pos-cats a { white-space: nowrap; }
  .pos-right { position: relative; }
}

/* ================= Telefona ================= */
@media (max-width: 560px) {
  .container { padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .btn { padding: 12px 16px; }
  .brand b { font-size: 19px; }
  .acct .cart { padding: 10px; font-size: 14px; }
  .search .btn { padding: 0 14px; }

  .banner-text { padding: 28px 20px; }
  .banner h1 { font-size: 28px; }
  .banner p { font-size: 16px; }
  .banner .btn { align-self: stretch; }
  .tile h3 { font-size: 22px; }
  .perk { padding: 14px 10px; }
  .cat-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-tile { padding: 16px 14px; }
  .cat-tile b { font-size: 17px; }

  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-img img { padding: 8px; }
  .card-title { font-size: 15px; }
  .price { font-size: 17px; margin-bottom: 10px; }
  .price s { display: block; margin: 2px 0 0; font-size: 13px; }
  .card .btn { padding: 11px 6px; font-size: 11px; letter-spacing: .5px; }
  .fav { opacity: 1; top: 8px; right: 8px; font-size: 10px; padding: 4px 7px; }
  .disc, .oos { top: 8px; left: 8px; }

  .pd h1 { font-size: 24px; }
  .pd .meta { gap: 10px; font-size: 14px; }
  .buy { gap: 10px; }
  .buy .qty { flex-basis: 100%; justify-content: space-between; }
  .buy .qty input { flex: 1; }
  .buy .btn { flex-basis: 100%; }

  .cart-item { grid-template-columns: 64px 1fr auto; gap: 10px; }
  .cart-item .qty { grid-column: 2 / 4; justify-self: start; }
  .summary { padding: 18px; }
  .auth > .panel { padding: 20px; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dt { margin-top: 8px; }
  .success { padding: 30px 18px; }
  .success h1 { font-size: 30px; }
  footer .cols { grid-template-columns: 1fr; gap: 22px; }

  /* Dritaret dalin nga poshtë, si në aplikacione */
  .modal-bg { padding: 0; align-items: end; place-items: end stretch; }
  .modal, .modal.wide { max-width: none; width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 14px 14px 0 0; }
  .modal-head { padding: 14px 16px; }
  .modal-head h3 { font-size: 21px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 auto; }
  .offer-pop .modal { border-radius: 14px 14px 0 0; }
  .op-img { height: 160px; }
  .op-body { padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); }
  .op-body h2 { font-size: 26px; }
  .op-products { grid-template-columns: 1fr 1fr; }
  .op-products a:nth-child(3) { display: none; }

  #toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .wa-float { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); padding: 10px 14px; font-size: 13px; }

  .admin-top h1 { font-size: 24px; }
  .stat b { font-size: 19px; }
  .row, .row3 { grid-template-columns: 1fr; gap: 0; }
  .adj input[name="reason"] { flex: 1; min-width: 0; }
  .pos-grid { grid-template-columns: 1fr 1fr; }
  .pos-total b { font-size: 28px; }
}

/* Telefona shumë të vegjël (p.sh. iPhone SE, Galaxy A0x) */
@media (max-width: 360px) {
  .brand-mark { width: 34px; height: 34px; }
  .brand b { font-size: 17px; }
  .grid { gap: 8px; }
  .card { padding: 0; }
  .card-title { font-size: 14px; }
}

/* Koka e panelit në telefon */
.adm-mtop { display: none; position: sticky; top: 0; z-index: 200; align-items: center; gap: 12px; background: var(--ink); color: #fff;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
.adm-mtop .burger { background: rgba(255, 255, 255, .1); }
.adm-mtop .burger span { background: #fff; }
.adm-mtop b { flex: 1; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .adm-mtop { display: flex; } } /* pas rregullit bazë, që të mos mbulohet prej tij */

/* Pa animacione për ata që i kanë çaktivizuar */
@media (prefers-reduced-motion: reduce) {
  .drawer, .admin-side, .burger span, .drawer-bg { transition: none; }
}
