/*
Theme Name: Feriwaala Agro Store
Author: Feriwaala Agro
Version: 2.0.0
*/

:root {
  --bg: #ffffff;
  --fg: #000000;
  --btn-bg: #2196f3;
  --btn-fg: #ffffff;
  --line: #e5e7eb;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  text-shadow: var(--shadow);
  padding-bottom: 72px;
  overflow-x: hidden;
}

.fa-hide { display: none !important; }

/* Header */
.fa-hd {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.fa-hd.is-fixed { position: sticky; top: 0; z-index: 910; }
.fa-hd img { max-height: 50px; width: auto; }
.fa-hd-txt { text-align: center; }
.fa-hd-title { font-size: 26px; font-weight: 800; line-height: 1.15; }
.fa-hd-sub { font-size: 13px; opacity: 0.85; }

/* Search Bar */
.fa-srch-wrap {
  width: 100%; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.fa-srch-wrap.is-fixed { position: sticky; top: 0; z-index: 900; }
.fa-srch-box {
  display: flex; width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; background: #fff;
}
.fa-srch-in {
  flex: 1; border: 0; outline: 0; padding: 10px 12px; font-size: 15px; color: var(--fg); background: transparent;
}
.fa-srch-in::placeholder { color: rgba(0,0,0,0.35); font-style: italic; }
.fa-srch-btn {
  background: var(--btn-bg); color: var(--btn-fg); border: 0; padding: 0 18px; font-weight: 700; cursor: pointer;
}

/* Promo Banner */
.fa-promo {
  position: relative; width: 100%; height: 175px; overflow: hidden; border-bottom: 1px solid var(--line);
}
.fa-promo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s;
}
.fa-promo img.on { opacity: 1; }

/* Horizontal Category Bar (Drag + Scroll) */
.fa-cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px;
  scrollbar-width: none; border-bottom: 1px solid var(--line); cursor: grab; user-select: none;
}
.fa-cats.drag { cursor: grabbing; }
.fa-cats::-webkit-scrollbar { display: none; }
.fa-cat {
  flex: 0 0 auto; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #f9fafb; color: var(--fg); font-size: 13px; cursor: pointer;
}
.fa-cat.on { background: #000; color: #fff; border-color: #000; }

/* Product Grid: 2 Columns on Mobile */
.fa-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px;
}
@media (min-width: 768px) {
  .fa-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
.fa-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  display: flex; flex-direction: column; justify-content: space-between; background: #fff;
}
.fa-media {
  width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; cursor: pointer; background: #f3f4f6;
}
.fa-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fa-p-title { font-size: 14px; font-weight: 600; margin-top: 8px; cursor: pointer; }
.fa-p-price { font-size: 14px; font-weight: 700; margin: 4px 0 8px; }
.fa-add {
  width: 100%; padding: 8px; border: 1px solid #000; background: #000; color: #fff;
  border-radius: 5px; font-weight: 600; cursor: pointer;
}
.fa-qty {
  display: none; align-items: center; justify-content: space-between; border: 1px solid #000; border-radius: 5px;
}
.fa-qty.show { display: flex; }
.fa-qty button {
  width: 34px; height: 32px; border: 0; background: #f3f4f6; color: #000; font-size: 16px; font-weight: 700; cursor: pointer;
}

/* Floating Cart Button #1 */
.fa-float-cart {
  position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 950;
  width: 52px; height: 52px; border-radius: 50%; background: #000; color: #fff;
  border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.25); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.fa-badge {
  position: absolute; top: -4px; right: -4px; background: #dc2626; color: #fff;
  font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* Cart Drawer (>50% screen width on mobile) */
.fa-drawer {
  position: fixed; top: 0; right: -100%; width: 65%; max-width: 440px; height: 100vh;
  background: #fff; color: #000; z-index: 1000; box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; transition: right 0.25s ease;
}
.fa-drawer.open { right: 0; }
.fa-drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.fa-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.fa-row img { width: 42px; height: 42px; object-fit: cover; border-radius: 4px; }
.fa-drawer-ft {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px;
}
.fa-btn-green {
  width: 100%; padding: 11px; background: #16a34a; color: #fff; border: 0;
  border-radius: 6px; font-weight: 700; cursor: pointer; margin-top: 8px;
}

/* Modal */
.fa-modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 1100; align-items: center; justify-content: center; padding: 14px;
}
.fa-modal.open { display: flex; }
.fa-modal-box {
  background: #fff; color: #000; width: 100%; max-width: 480px; max-height: 90vh;
  overflow-y: auto; border-radius: 10px; padding: 16px;
}
.fa-f { margin-bottom: 10px; }
.fa-f label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.fa-f input { width: 100%; padding: 9px 10px; border: 1px solid #9ca3af; border-radius: 6px; color: #000; }
.fa-err { color: #dc2626; font-size: 12px; display: none; margin-top: 3px; }

/* Fixed Blurred Bottom Bar (4 Buttons) */
.fa-bot {
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 940;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.12); padding: 6px 4px;
}
.fa-bot button {
  background: transparent; border: 0; color: #000; font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; padding: 4px;
}