/* Pinnacle Mart x Cloudflare — demo environment
   Brand: Crimson #C41E3A, Forest Green #1B5E20, White; Cloudflare Orange #F6821F
   ------------------------------------------------------------------ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pm-red:      #C41E3A;
  --pm-red-dk:   #8B0000;
  --pm-green:    #1B5E20;
  --pm-green-lt: #2E7D32;
  --pm-gold:     #F9A825;
  --cf-orange:   #F6821F;
  --cf-orange-lt:#FFA45B;
  --white:       #ffffff;
  --off-white:   #f7f7f5;
  --gray-100:    #f0f1f3;
  --gray-300:    #d2d5da;
  --gray-600:    #5a5f68;
  --gray-900:    #1c1e22;
  --text:        #1c1e22;

  --font: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--pm-gold); outline-offset: 2px; border-radius: 3px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.1s;
  text-decoration: none;
  border: 2px solid transparent;
  letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--pm-red);
  color: var(--white);
  border-color: var(--pm-red);
}
.btn-primary:hover { background: var(--pm-red-dk); border-color: var(--pm-red-dk); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }

/* ── Site header ── */
.site-header {
  background: var(--pm-red);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 60px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.pm-logo { height: 30px; width: 30px; }

.logo-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-name {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.logo-tagline {
  color: rgba(255,255,255,0.7);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: rgba(255,255,255,0.88);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.site-nav a:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.nav-highlight {
  background: var(--pm-green) !important;
  color: var(--white) !important;
  font-weight: 700 !important;
}
.nav-highlight:hover { background: var(--pm-green-lt) !important; }

.ops-login-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  border: 1.5px solid rgba(255,255,255,0.2);
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: not-allowed;
  letter-spacing: 0.02em;
}
.ops-login-btn[data-active="true"] {
  color: var(--white);
  background: rgba(246,130,31,0.18);
  border-color: var(--cf-orange);
  cursor: pointer;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--pm-red-dk) 0%, var(--pm-red) 55%, #d32f2f 100%);
  color: var(--white);
  padding: 4.5rem 1.5rem 0;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M20 20h-4v-4h4v4zm0-20h-4v4h4V0zM0 20h4v-4H0v4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge { margin-bottom: 1.25rem; }
.badge-pill {
  display: inline-block;
  background: rgba(246,130,31,0.18);
  border: 1px solid var(--cf-orange);
  color: var(--cf-orange-lt);
  padding: 0.3rem 1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Stat strip — green bar at base of hero */
.hero-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--pm-green);
  color: var(--white);
  margin: 0 -1.5rem;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* ── Shared section ── */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 900;
  color: var(--pm-red-dk);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--gray-600);
  font-size: 1.05rem;
  max-width: 600px;
  margin-bottom: 2.5rem;
}

/* ── Departments ── */
.dept-section { background: var(--off-white); }

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.dept-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.dept-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--pm-red);
}

.dept-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  display: block;
}

.dept-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pm-red-dk);
  margin-bottom: 0.5rem;
}

.dept-card p {
  font-size: 0.92rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ── Weekly Deals ── */
.deals-section { background: var(--white); }

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.deal-card {
  background: var(--off-white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: box-shadow var(--transition);
}
.deal-card:hover { box-shadow: var(--shadow); }
.deal-card.member-deal { border-color: var(--pm-gold); background: #fffbf0; }

.deal-badge {
  display: inline-block;
  background: var(--pm-red);
  color: var(--white);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.deal-badge.member {
  background: var(--pm-gold);
  color: var(--gray-900);
}

.deal-card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.35rem;
}

.deal-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.deal-price {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--pm-red);
}
.deal-was {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--gray-600);
  text-decoration: line-through;
  margin-left: 0.35rem;
}

/* ── Store finder ── */
.finder-section {
  background: var(--pm-green);
  color: var(--white);
}
.finder-section h2 { color: var(--white); }
.finder-section .section-sub { color: rgba(255,255,255,0.72); }

.finder-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.finder-input {
  flex: 1;
  min-width: 220px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.finder-input::placeholder { color: rgba(255,255,255,0.45); }
.finder-input:focus { border-color: var(--pm-gold); background: rgba(255,255,255,0.16); }

.finder-section .btn-primary {
  background: var(--white);
  color: var(--pm-green);
  border-color: var(--white);
}
.finder-section .btn-primary:hover {
  background: var(--pm-gold);
  color: var(--gray-900);
  border-color: var(--pm-gold);
}

.finder-results {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.finder-searching { margin-bottom: 0.5rem; }
.finder-hint { color: rgba(255,255,255,0.55); font-size: 0.85rem; }

.finder-sample h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pm-gold);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.store-list { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; }

.store-item {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 4px solid var(--pm-gold);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-size: 0.93rem;
  color: rgba(255,255,255,0.88);
  line-height: 1.55;
}
.store-item strong { color: var(--white); }

/* ── Pharmacy ── */
.pharmacy-section { background: var(--white); }

.pharm-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.pharm-copy h2 { margin-bottom: 1rem; }
.pharm-copy p { color: var(--gray-600); margin-bottom: 1rem; max-width: 560px; }
.pharm-copy .btn { margin-top: 1rem; }

.cloudflare-badge-block { flex-shrink: 0; }

.cf-badge {
  background: var(--gray-100);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  min-width: 220px;
  text-align: center;
}

.cf-logo { height: 20px; margin: 0 auto 0.75rem; }

.cf-badge-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.4;
  margin-bottom: 1rem;
}
.cf-badge-label strong { color: var(--gray-900); }

.cf-badge-list {
  list-style: none;
  text-align: left;
  font-size: 0.8rem;
  color: var(--gray-600);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cf-badge-list li::before {
  content: '\2713  ';
  color: var(--cf-orange);
  font-weight: 700;
}

/* ── Pickup ── */
.pickup-section { background: var(--off-white); }

.pickup-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.pickup-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border-top: 4px solid var(--pm-red);
}

.pickup-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--pm-red-dk);
  margin-bottom: 0.5rem;
}

.pickup-card p {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* ── Footer ── */
.site-footer {
  background: var(--gray-900);
  border-top: 3px solid var(--pm-red);
  color: rgba(255,255,255,0.75);
  padding: 3rem 1.5rem 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 2.5rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pm-logo-footer { height: 24px; width: 24px; margin-bottom: 0.25rem; }
.footer-name { font-size: 1.05rem; font-weight: 900; color: var(--white); }
.footer-tagline { font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.footer-legal { font-size: 0.72rem; color: rgba(255,255,255,0.38); line-height: 1.5; max-width: 280px; margin-top: 0.5rem; }

.footer-links h4 {
  color: var(--pm-red);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }

.footer-cf { text-align: right; }
.footer-cf-label { font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-bottom: 0.5rem; }
.cf-footer-logo { height: 16px; margin-left: auto; }

/* ── SE panel ── */
#sePanel {
  background: var(--gray-100);
  border-top: 3px solid var(--cf-orange);
}

/* ── Chat widget ── */
#chatLaunch {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--pm-green);
  color: var(--white);
  border: 2px solid var(--pm-gold);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: background var(--transition), box-shadow var(--transition);
  letter-spacing: 0.02em;
}
#chatLaunch:hover {
  background: var(--pm-red);
}

#chatPanel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 360px;
  max-height: 520px;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
#chatPanel:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#chatPanel header {
  background: var(--pm-green);
  color: var(--white);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.92rem;
  flex-shrink: 0;
  border-bottom: 2px solid var(--pm-gold);
}

#chatClose {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}
#chatClose:hover { color: var(--white); }

#chatLog {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

#chatLog .msg { max-width: 82%; line-height: 1.55; }
#chatLog .msg.user {
  align-self: flex-end;
  background: var(--pm-red);
  color: var(--white);
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 2px 12px;
}
#chatLog .msg.bot {
  align-self: flex-start;
  background: var(--gray-100);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 12px 2px;
}
#chatLog .msg.system {
  align-self: flex-start;
  background: #fff0e0;
  border: 1px solid var(--cf-orange);
  color: #7a3800;
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 12px 2px;
  font-size: 0.85rem;
}

#chatForm {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid var(--gray-300);
  flex-shrink: 0;
}

#chatInput {
  flex: 1;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
#chatInput:focus { border-color: var(--pm-green); }

#chatSend {
  background: var(--pm-red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
}
#chatSend:hover { background: var(--pm-red-dk); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .pharm-inner { grid-template-columns: 1fr; }
  .cloudflare-badge-block { justify-self: center; }
  .footer-inner { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .footer-cf { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 600px) {
  .site-nav { display: none; }
  .hero-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  #chatPanel { width: calc(100vw - 2rem); right: 1rem; }
}
