/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --gold: #A56F12;
  --charcoal: #1c1c1c;
  --cream: #f8f5ef;
  --warm-white: #fdfbf7;

  --gold-light: #e6d3a3;
  --gold-dark: #a3844c;

  --border: #e5e0d8;

  --mid: #6b6b6b;
  --light-text: #9c9c9c;

  --font-display: "Playfair Display", serif;
  --font-body: "Inter", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--cream);
  font-family: var(--font-body);
}

/* NAV */
.nav {
  background: var(--cream);
  border-bottom: 1px solid transparent;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  width: 100%;
}

.logo {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.18em;
  color: var(--charcoal);
}

.header-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.tagline {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light-text);
}

/* HERO */
.hero {
  height: 70vh;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  background-size: cover;
  background-position: center;

  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.55)),
    url(<%= @banner.image %>);
}

.hero-content {
  color: white;
}

.hero-label {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 64px;
  font-style: italic;
}

.hero-desc {
  color: rgba(255,255,255,0.8);
  margin-bottom: 30px;
}

.hero-btn {
  border: 1px solid rgba(255,255,255,0.7);
  background: transparent;
  color: white;
  padding: 12px 30px;
}

/* CATALOG */
.catalog {
  padding: 72px 32px;
}

.section-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 42px;
  font-style: italic;
  color: var(--charcoal);
}

/* FILTER */
.filters {
  text-align: center;
  margin: 40px 0;
}

.filter-btn {
  border: 1px solid var(--border);
  background: none;
  color: var(--mid);
  padding: 10px 22px;
  margin: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-btn--active {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: var(--gold-light);
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* CARD */
.card {
  background: #fff;
  transition: box-shadow 0.3s;
  overflow: hidden;
  position: relative;
}

.discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #e53e3e;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  z-index: 1;
}

.card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.card:hover .img {
  transform: scale(1.05);
}

.card-img {
  aspect-ratio: 4 / 3;
  background: var(--warm-white);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.placeholder {
  font-size: 32px;
  color: var(--border);
}

.card-body {
  padding: 16px;
}

.card-category {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--light-text);
  display: block;
  margin-bottom: 4px;
}

.card-body h3 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.card-description {
  font-size: 12px;
  color: var(--mid);
  margin-bottom: 12px;
  line-height: 1.5;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border-top: none;
  padding: 0;
}

.card-price {
  display: flex;
  flex-direction: column;
}

.price {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--charcoal);
}

.original {
  font-size: 13px;
  text-decoration: line-through;
  color: var(--light-text);
}

.cart-icon-wrap {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn {
  border: 1px solid var(--charcoal);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  background: none;
  cursor: pointer;
}

.add-btn:hover {
  background: var(--charcoal);
  color: var(--gold-light);
}

/* CART SIDEBAR */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
}

.cart-overlay--open {
  display: block;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: #fff;
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-panel--open {
  transform: translateX(0);
}

.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.cart-panel-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--charcoal);
}

.cart-panel-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--mid);
  cursor: pointer;
  padding: 4px 8px;
}

.cart-panel-close:hover { color: var(--charcoal); }

.cart-panel-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty {
  color: var(--light-text);
  font-size: 13px;
  text-align: center;
  margin-top: 40px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-photo-wrap {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: var(--warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-item-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-photo-placeholder {
  font-size: 20px;
  color: var(--border);
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-item-name {
  font-size: 14px;
  color: var(--charcoal);
  font-family: var(--font-display);
}

.cart-item-unit {
  font-size: 11px;
  color: var(--light-text);
}

.cart-item-subtotal {
  font-size: 13px;
  color: var(--charcoal);
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--light-text);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.cart-item-remove:hover { color: #e53e3e; }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--charcoal);
  font-weight: 600;
  border-top: 2px solid var(--charcoal);
  margin-top: 8px;
}

.cart-panel-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.cart-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.cart-whatsapp-btn:hover { background: #1ebe5d; }

/* FOOTER */
.footer {
  background: var(--gold);
  color: var(--gold-light);
  padding: 64px 32px 0;
}

.footer-grid {
  display: flex;
  justify-content: center;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
  max-width: 360px;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.1em;
  color: #fff;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-social a {
  color: var(--gold-light);
  font-size: 14px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-social a:hover { opacity: 1; }

.footer-col h4 {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul a {
  color: var(--gold-light);
  text-decoration: none;
  font-size: 13px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-col ul a:hover { opacity: 1; }

.footer-newsletter-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.footer-newsletter {
  display: flex;
}

.footer-newsletter input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 10px 14px;
  font-size: 12px;
  outline: none;
}

.footer-newsletter input::placeholder { color: rgba(255,255,255,0.3); }

.footer-newsletter button {
  background: var(--gold);
  border: none;
  color: #fff;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.footer-newsletter button:hover { background: var(--gold-dark); }

.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.08em;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .tagline { display: none; }
  .logo { font-size: 22px; }

  .hero { height: 55vh; min-height: 320px; }
  .hero-title { font-size: 36px; }
  .hero-desc { font-size: 13px; margin-bottom: 20px; }

  .catalog { padding: 48px 16px; }
  .section-title { font-size: 30px; }

  .filters { margin: 24px 0; }
  .filter-btn { padding: 8px 14px; font-size: 10px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .cart-panel { width: 100%; }

  .footer { padding: 40px 16px 0; }
  .footer-brand { max-width: 100%; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}
