@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

/*
  Recetas Karmy — Base UI
  Objetivo: look & feel tipo app móvil, sombras suaves, transiciones suaves,
  sin romper los .active (login/overlays) que ya usa el proyecto.

  Paleta (60/30/10):
  - 60%: fondo neutro (bg)
  - 30%: superficies/cards (surface)
  - 10%: acento aqua (accent)
*/

:root{
  --bg: #f5f7fb;                 /* 60 */
  --surface: #ffffff;            /* 30 */
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, .10);

  --accent: #12d4d6;             /* 10 (aqua) */
  --accent-2: #0aa9ad;
  --accent-ink: #062a2b;

  --danger: #e11d48;
  --success: #16a34a;

  --radius-xs: .6rem;
  --radius-sm: .9rem;
  --radius-md: 1.2rem;
  --radius-lg: 1.6rem;

  --shadow-sm: 0 6px 18px rgba(2, 8, 23, .08);
  --shadow-md: 0 14px 40px rgba(2, 8, 23, .12);

  --ring: 0 0 0 .2rem rgba(18, 212, 214, .22);
}

*{ box-sizing: border-box; 
  padding: 0;
  margin: 0;
  text-decoration: none;
  transition: all .2s linear;
}

html{
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body{
  margin: 0;
  font-family: "Google Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color: inherit; text-decoration: none; }

img{
  display: block;
  max-width: 100%;
}

button, input{
  font-family: inherit;
}

button{
  cursor: pointer;
  background: transparent;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible{
  outline: none;
  box-shadow: var(--ring);
  border-radius: .6rem;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Layout base */


/* Mejor ergonomía en desktop: centra el contenido, sin afectar el header fijo */
section{
  padding: 2rem 6%;
  min-height: 100vh;
  cursor: default;
}

@media(max-width:1200px){
  section{
    padding: 1rem 3%;
  }
}



/* =========================================================
   Cards (entrantes/segundos/postres)
   ========================================================= */

@keyframes cardIn{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

.cardEntrante,
.cardSegundo,
.cardPostre{
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  gap: .85rem;

  padding: 1rem;

  animation: cardIn .28s ease-out both;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

@media (hover:hover){
  .cardEntrante:hover,
  .cardSegundo:hover,
  .cardPostre:hover{
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(18, 212, 214, .22);
  }
}

.cardEntrante img,
.cardSegundo img,
.cardPostre img{
  width: 100%;
  height: 15rem;
  object-fit: cover;
  border-radius: 1.15rem;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 10px 26px rgba(2, 8, 23, .10);
}

.nameReceta{
  margin: 0;
  padding: .15rem .1rem;
  font-size: clamp(1.35rem, 3.8vw, 2.1rem);
  line-height: 1.15;
  font-weight: 1000;
  letter-spacing: -0.03em;
  padding-right: 3.1rem; /* deja espacio al corazón (fav) si lo ponemos flotante */
}

.personasReceta{
  margin: 0;
  font-weight: 900;
  color: rgba(15, 23, 42, .78);
}

.descripcionReceta{
  margin: 0;
  font-weight: 700;
  color: rgba(15, 23, 42, .75);
  line-height: 1.45;
}

.jerarquia{
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
  font-weight: 900;
  color: rgba(15, 23, 42, .78);
  font-size: .92rem;
}

/* Badges */
.plateType{
  margin: 0;
  width: max-content;
  padding: .35rem .65rem;
  border-radius: 999px;
  font-weight: 1000;
  letter-spacing: .02em;
  font-size: .85rem;
  color: var(--accent-ink);
  background: rgba(18, 212, 214, .16);
  border: 1px solid rgba(18, 212, 214, .32);
}

.ingredientesReceta{
  margin: 0;
  padding: .85rem .95rem;
  border-radius: 1.2rem;
  background: var(--surface-2);
  border: 1px solid rgba(15, 23, 42, .08);
}

.ingredientesReceta h2{
  margin: 0 0 .55rem 0;
  font-size: 1.05rem;
  font-weight: 1000;
  color: rgba(15, 23, 42, .85);
}

.ingredientesReceta li{
  margin-left: 1.1rem;
  padding: .1rem 0;
  font-weight: 800;
  color: rgba(15, 23, 42, .80);
}

.textPre{
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-weight: 1000;
  color: rgba(15, 23, 42, .85);
}

.preparacion{
  font-weight: 750;
  color: rgba(15, 23, 42, .82);
  line-height: 1.5;
}

/* =========================================================
   Botones (fav / editar / borrar)
   Importante: NO cambia los .active que ya usas en JS.
   ========================================================= */

.favForm{
  position: absolute;
  top: .85rem;
  right: .85rem;
  z-index: 2;
}

.favBtn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(2, 8, 23, .12);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.favBtn:active{ transform: scale(.97); }

.favBtn i{
  font-size: 1.25rem;
  color: rgba(100, 116, 139, .95);
}

.favBtn i.fa-solid{
  color: var(--danger);
  text-shadow: 0 10px 26px rgba(225, 29, 72, .24);
}

.cardActions{
  display: flex;
  gap: .55rem;
  justify-content: flex-end;
  margin-top: .25rem;
}

/* Por seguridad: ocultos por defecto; se muestran con .active (sesión) */
.editThis,
.deleteThis{
  display: none;
}

.editThis.active,
.deleteThis.active{
  display: inline-flex;
}

.editThis,
.deleteThis{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
  box-shadow: 0 12px 30px rgba(2, 8, 23, .10);

  align-items: center;
  justify-content: center;

  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease, border-color .12s ease;
}

.editThis i{ color: rgba(15, 23, 42, .80); font-size: 1.15rem; }
.deleteThis i{ color: rgba(225, 29, 72, .92); font-size: 1.1rem; }

.editThis:active,
.deleteThis:active{
  transform: scale(.97);
}

@media (hover:hover){
  .editThis:hover,
  .deleteThis:hover,
  .favBtn:hover{
    box-shadow: 0 18px 42px rgba(2,8,23,.14);
    border-color: rgba(18, 212, 214, .25);
  }
}

/* =========================================================
   Modal de borrado (deleteModal)
   ========================================================= */

.deleteModal{
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 8, 23, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.deleteModal.active{
  opacity: 1;
  pointer-events: auto;
}

.deleteModal .deleteBox{
  width: min(560px, 100%);
  background: var(--surface);
  border-radius: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(10px);
  transition: transform .18s ease;
}

.deleteModal.active .deleteBox{
  transform: translateY(0);
}

.deleteModal .deleteBox h2{
  margin: 0 0 .35rem 0;
  font-weight: 1000;
  letter-spacing: -0.02em;
  color: var(--text);
}

.deleteModal .deleteBox p{
  margin: 0 0 .9rem 0;
  color: rgba(15, 23, 42, .85);
  font-weight: 700;
  line-height: 1.4;
}

.deleteModal .deleteBtns{
  display: flex;
  gap: .75rem;
}

.deleteModal .deleteBtns button{
  flex: 1;
  padding: .9rem 1rem;
  border-radius: 1rem;
  font-weight: 900;
  border: 1px solid var(--border);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.deleteModal .deleteBtns button:active{ transform: scale(.99); }

.deleteModal .deleteCancel{
  background: #eef2f6;
  color: var(--text);
}

.deleteModal .deleteConfirm{
  background: var(--danger);
  color: #fff;
  border-color: rgba(0,0,0,.08);
}

/* Pequeños ajustes de tipografía */
.typeEntrantes,
.typeSegundos,
.typePostres{
  letter-spacing: -0.02em;
}

/* Espacio para el header fijo */
.recetas{ margin-top: 6rem; }

/* Si existe la sección de "Agregar receta" antes, no necesitamos tanto margen */
.addRecetaCont + .recetas{ margin-top: 1rem; }

@media (min-width: 860px){
  .recetas{ margin-top: 6.2rem; }
  .addRecetaCont + .recetas{ margin-top: 1.2rem; }
}
