@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Special+Elite&display=swap');

:root {
  --primary: #a84238;
  --primary-light: #e6d3cf;
  --bg-color: #e5dfd3;
  --surface: #f4f1ea;
  --text-main: #2a2825;
  --text-muted: #5e5952;
  --border: #c4beb1;
  --danger: #9c2b1f;
  --tape: rgba(219, 211, 193, 0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Special Elite', cursive;
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(var(--border) 1px, transparent 1px),
    radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
header {
  background-color: var(--surface);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 2px dashed var(--border);
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.logo-container {
  height: 36px;
  display: flex;
  align-items: center;
}

.logo-container img {
  height: 100%;
  object-fit: contain;
  filter: sepia(0.3) contrast(1.2);
}

.header-actions button {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-main);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: rotate(5deg);
}

/* Categories Filter */
.categories-wrapper {
  background-color: var(--surface);
  padding: 16px;
  flex-shrink: 0;
  border-bottom: 2px solid var(--text-main);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.categories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  background-color: var(--bg-color);
  color: var(--text-main);
  border: 1px dashed var(--text-muted);
  padding: 6px 14px;
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  white-space: nowrap;
  cursor: pointer;
  transform: rotate(-2deg);
  transition: all 0.2s ease;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.category-chip:nth-child(even) {
  transform: rotate(2deg);
}

.category-chip.active {
  background-color: var(--text-main);
  color: var(--surface);
  border-style: solid;
  transform: scale(1.05) rotate(0deg);
  box-shadow: 2px 2px 0px var(--border);
}

/* Main Content (Feed) */
main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 80px 16px; /* Space for bottom nav */
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  display: none;
  font-family: 'Patrick Hand', cursive;
  font-size: 20px;
}

.empty-state.active {
  display: flex;
}

.empty-state span.material-symbols-rounded {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--text-muted);
  transform: rotate(-10deg);
}

/* Offer Cards */
.offer-card {
  background: var(--surface);
  padding: 12px;
  border: 1px solid var(--border);
  margin-bottom: 32px;
  box-shadow: 3px 3px 0 var(--border), 4px 4px 10px rgba(0,0,0,0.05);
  position: relative;
  transition: transform 0.2s ease;
}

.offer-card:nth-child(odd) { transform: rotate(-1.5deg); }
.offer-card:nth-child(even) { transform: rotate(1.5deg); }

.offer-card:active {
  transform: scale(0.98) rotate(0deg);
}

.offer-card::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 100px;
  height: 25px;
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  z-index: 5;
  mix-blend-mode: multiply;
}

.offer-card:nth-child(even)::before {
  transform: translateX(-50%) rotate(3deg);
  left: 40%;
}

.offer-image-container {
  position: relative;
  height: 200px;
  width: 100%;
  border: 1px solid var(--text-main);
  filter: sepia(0.3) contrast(1.1) desaturate(0.2);
}

.offer-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: -10px;
  left: -10px;
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--text-main);
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  padding: 2px 8px;
  transform: rotate(-10deg);
  box-shadow: 2px 2px 0 var(--text-main);
  z-index: 2;
}

.save-btn {
  position: absolute;
  bottom: -20px;
  right: -10px;
  background: var(--surface);
  border: 2px solid var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--text-main);
  z-index: 10;
  transition: transform 0.2s;
}

.save-btn:active {
  transform: scale(0.9);
}

.save-btn .material-symbols-rounded {
  color: var(--text-muted);
  font-size: 24px;
  transition: color 0.2s;
}

.save-btn.saved .material-symbols-rounded {
  color: var(--primary);
  font-variation-settings: 'FILL' 1;
}

.offer-details {
  padding: 16px 4px 4px 4px;
}

.offer-category {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 6px;
}

.offer-title {
  font-size: 18px;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  background: var(--text-main);
  color: var(--surface);
  display: inline;
  padding: 2px 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.offer-description {
  margin-top: 12px;
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  color: var(--text-main);
  line-height: 1.4;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: var(--surface);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 2px dashed var(--text-main);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
  box-shadow: 0 -4px 6px rgba(0,0,0,0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 100%;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.2s;
}

.nav-item .material-symbols-rounded {
  font-size: 26px;
  transition: all 0.2s ease;
}

.nav-item.active {
  color: var(--text-main);
  transform: scale(1.1) rotate(-2deg);
}

.nav-item.active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1;
  color: var(--text-main);
}