/* =========================
   VARIABLES
========================= */
:root {
  --bg-main: #f3ede6;
  --bg-card: #fff8f1;
  --brown-dark: #2b2118;
  --brown-main: #7a5230;
  --brown-light: #c9a27c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--brown-dark);
  overflow-x: hidden;
}

/* =========================
   SVG FONDO
========================= */
.bg-svg {
  position: fixed;
  width: 700px;
  opacity: 0.18;
  stroke: var(--brown-light);
  fill: none;
  stroke-width: 4;
  z-index: -1;
}

.bg-top { top: -200px; left: -200px; }
.bg-bottom { bottom: -200px; right: -200px; }

/* =========================
   NAV
========================= */
.top-nav {
  display: flex;
  justify-content: space-between;
  padding: 24px 32px;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
}

.login-btn {
  background: var(--brown-main);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-size: cover;
}

.hidden { display: none; }

/* =========================
   HERO
========================= */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 80px 10%;
}

.hero-content {
  max-width: 520px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  line-height: 1.1;
}

.hero p {
  margin-top: 16px;
  opacity: .85;
}

.hero blockquote {
  margin-top: 28px;
  font-style: italic;
  opacity: .7;
}

.latte-art {
  width: 240px;
  stroke: var(--brown-light);
  fill: none;
  stroke-width: 6;
  opacity: .6;
}

/* =========================
   TABS
========================= */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 48px;
  background: var(--bg-card);
  padding: 18px;
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.tab-btn.active {
  border-bottom: 2px solid var(--brown-main);
}

/* =========================
   VIEWS
========================= */
.view {
  display: none;
  padding: 60px 8% 80px;
}

.view.active { display: block; }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
}

.section-intro {
  opacity: .7;
  margin-bottom: 32px;
}

/* =========================
   GRID
========================= */
.coffee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.coffee-card {
  background: var(--bg-card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,.08);
}

.coffee-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.card-content {
  padding: 18px;
}

/* =========================
   RANKING
========================= */
.ranking-list {
  max-width: 700px;
  margin: auto;
}

.rank-item {
  background: var(--bg-card);
  padding: 18px;
  border-radius: 18px;
  margin-bottom: 14px;
}

/* =========================
   FAB
========================= */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c9a27c, #7a5230);
  color: white;
  font-size: 2.4rem;
  border: none;
  cursor: pointer;
}

/* =========================
   MODAL
========================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #fffdf9;
  padding: 26px;
  border-radius: 18px;
  width: 92%;
  max-width: 420px;
  position: relative;
}

.modal-card h3 {
  margin-top: 0;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: .85rem;
  opacity: .7;
  margin-bottom: 18px;
}

/* =========================
   BOTÓN CERRAR
========================= */
.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brown-main);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}

.close-modal:hover {
  background: var(--brown-dark);
  transform: scale(1.05);
}

/* =========================
   FORM MODAL
========================= */
.modal-card input,
.modal-card textarea,
.modal-card select {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid #e0d4c6;
  background: #fff;
  font-size: .95rem;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.score-label {
  font-size: .85rem;
  margin-bottom: 14px;
  display: block;
}

.file-upload {
  display: block;
  padding: 12px;
  border: 1px dashed #d6c4b0;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  background: #faf7f3;
}

.save-btn {
  width: 100%;
  background: var(--brown-main);
  color: white;
  border: none;
  padding: 13px;
  border-radius: 999px;
  font-size: .95rem;
  cursor: pointer;
}

/* =========================
   FOOTER
========================= */
.footer {
  text-align: center;
  padding: 32px;
  opacity: .6;
  font-size: .9rem;
}

/* =========================
   FILTROS
========================= */
.filters {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filters select {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d6c4b0;
  background: #fff;
  font-size: .9rem;
  cursor: pointer;
  min-width: 220px;
}

/* =====================================================
   🔥 EXTENSIONES NUEVAS (SIN TOCAR LO ANTERIOR)
===================================================== */

/* Imágenes más pequeñas y cuadradas SOLO en ranking */
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rank-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

/* Perfil: acciones editar / eliminar */
.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.profile-actions button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: .8rem;
  cursor: pointer;
  border: none;
}

.edit-btn {
  background: var(--brown-light);
}

.delete-btn {
  background: #a04b3b;
  color: white;
}
/* =========================
   RESPONSIVE – MOBILE FIRST
========================= */
@media (max-width: 768px) {

  body {
    font-size: 15px;
  }

  /* NAV */
  .top-nav {
    padding: 16px 18px;
  }

  .logo {
    font-size: 1.7rem;
  }

  /* HERO */
  .hero {
    flex-direction: column;
    padding: 48px 6% 32px;
    text-align: center;
    gap: 32px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .latte-art {
    width: 180px;
    margin: 0 auto;
  }

  /* TABS */
  .tab-nav {
    gap: 0;
    padding: 12px;
    justify-content: space-around;
  }

  .tab-btn {
    font-size: .9rem;
  }

  /* VIEWS */
  .view {
    padding: 40px 6% 60px;
  }

  /* GRIDS */
  .coffee-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .coffee-card img {
    height: 160px;
  }

  /* RANKING */
  .ranking-list {
    padding: 0;
  }

  .rank-item {
    display: flex;
    gap: 14px;
    align-items: center;
  }

  .rank-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
  }

  /* FILTERS */
  .filters {
    flex-direction: column;
    gap: 12px;
  }

  .filters select {
    width: 100%;
  }

  /* MODAL */
  .modal-card {
    width: 94%;
    padding: 22px;
  }

  /* FAB */
  .fab {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    bottom: 22px;
    right: 22px;
  }

  /* FOOTER */
  .footer {
    padding: 24px 16px;
    font-size: .85rem;
  }
}
/* =========================
   MOBILE FIX - FAB
========================= */
@media (max-width: 768px) {
  .fab {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
  }
}
/* =========================
   MOBILE NAV FIX
========================= */
@media (max-width: 768px) {
  #logoutBtn {
    display: none;
  }

  .user-avatar {
    display: block !important;
    cursor: pointer;
  }
}
