:root{
  --bg: #0f1724;
  --card: rgba(26, 22, 66, 0.661);
  --accent: #ff6b35;
  --text: #f7fafc;
  --header-height: 72px; /* default header height for layout spacing */
}

*{box-sizing:border-box}
  
html,body{
   
    height:100%;
    margin:0;
    font-family:Inter,Segoe UI,Arial,sans-serif;
    color:var(--text);
}

body::before{
  content: "";
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  z-index: -1;
  background: linear-gradient(180deg, rgba(255,229,0,1) 0%, rgb(255, 149, 0) 70%);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

main{min-height:100vh;  justify-content:center;  padding: 1rem 1rem; display:flex; flex-direction:column; align-items:center}

.main-box{
    
    display:flex;
    flex-direction:column;
    gap:1.5rem;
}

.encabezado-inter{
    margin-bottom: 1rem;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    max-width:980px;
    width:100%;
    margin: 0 auto 1rem auto;
    padding:0.5rem 0.75rem;
    background: linear-gradient(180deg, rgb(240, 140, 1), rgb(255, 196, 0));
    backdrop-filter: blur(6px);
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.28);
    white-space: nowrap;
    overflow: hidden;
    /* expose actual header height to layout (keeps main padded) */
    --header-height:72px;
}

#encabezado-img{
  width: 64px;
  height:64px;
  background-color: var(--text);
  border-radius: 50%;
  padding:8px;
  display:inline-block;
}

.encabezado-inter h2{
  font-size:1.25rem;
  margin:0;
  color:var(--text);
  font-weight:600;
  display:flex;
  align-items:center;
  gap:0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Votaciones page styles */
.votaciones-content{
  width:100%;
  max-width:980px;
  background: var(--card);
  border-radius: 12px;
  padding:1.25rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.04);
  margin:0 auto;
}

.votaciones-content h3{margin:0 0 0.5rem 0; color:var(--accent)}
.votaciones-content p{margin:0 0 1rem 0; color:rgba(247,250,252,0.9)}

.votaciones-content form{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:0.75rem;
  align-items:start;
}

.votaciones-content label{font-size:0.9rem; color:rgba(247,250,252,0.85); margin-bottom:0.25rem; display:block}
.votaciones-content input[type="text"],
.votaciones-content input[type="email"],
.votaciones-content select{
  width:100%;
  padding:0.6rem 0.8rem;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color:var(--text);
  outline: none;
}

.votaciones-content input:focus,
.votaciones-content select:focus{
  box-shadow: 0 3px 12px rgba(255,107,53,0.12);
  border-color: rgba(93, 68, 58, 0.9);
}

.votaciones-content form .full{grid-column: 1 / -1}

.vote-button{
  background: var(--accent);
  color:#fff;
  border:none;
  padding:0.8rem 1.1rem;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display:inline-block;
}
.vote-button:hover{transform:translateY(-3px); box-shadow:0 10px 20px rgba(0,0,0,0.28)}

.votaciones-content .actions{display:flex; justify-content:flex-end; align-items:center; gap:0.5rem}

/* Form feedback messages */
.form-message{
  display:none;
  padding:0.75rem 1rem;
  border-radius:8px;
  margin-bottom:1rem;
  font-weight:600;
  min-height:40px;
  line-height:1.5;
}

.form-message.hidden{display:none}

.form-message.success,
.form-message.error{
  display:block;
}

.form-message.success{
  background:rgba(76,175,80,0.15);
  border:1px solid rgba(76,175,80,0.4);
  color:#4CAF50;
}

.form-message.error{
  background:rgba(244,67,54,0.15);
  border:1px solid rgba(244,67,54,0.4);
  color:#f44336;
}

/* Results section */
.resultados{
  width:100%;
  max-width:980px;
  background: linear-gradient(135deg, rgba(34, 13, 65, 0.746), rgba(22, 3, 35, 0.887));
  border-radius: 16px;
  padding:1.5rem;
  color:rgba(254, 254, 254, 0.9);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border:2px solid rgba(255,107,53,0.2);
  margin:10px auto;
  backdrop-filter: blur(8px);
}

.resultados-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.resultados h3{
  margin:0;
  color:var(--accent);
  font-size:1.5rem;
  flex: 1;
  min-width: 200px;
}

.resultados-info{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.resultados-info p{
  margin: 0;
  color:rgba(247,250,252,0.9);
  flex: 1;
  min-width: 200px;
}

.ultimo-actualizado{
  display: inline-block;
  font-size: 0.85rem;
  color: rgba(255, 107, 53, 0.8);
  font-weight: 600;
  background: rgba(255, 107, 53, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 53, 0.2);
  white-space: nowrap;
}

/* Total votos badge */
.total-votos-badge{
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 107, 53, 0.15);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.badge-label{
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.95rem;
}

.badge-number{
  color: var(--accent);
  font-size: 1.75rem;
  font-weight: 700;
  min-width: 50px;
}

/* Results container and table */
.results-container{
  overflow-x: auto;
}

.results-table{
  width:100%;
  border-collapse:collapse;
  margin-top:0.5rem;
}

.results-table thead{
  background: rgba(255,107,53,0.12);
}

.results-table th{
  text-align:left;
  padding:1rem 0.75rem;
  color:var(--accent);
  font-weight:700;
  border-bottom:3px solid rgba(255,107,53,0.4);
  font-size: 0.95rem;
}

.results-table td{
  padding:1rem 0.75rem;
  border-bottom:1px solid rgba(255,255,255,0.08);
  color:rgba(247,250,252,0.9);
}

.results-table tbody tr{
  transition: background-color 0.2s ease;
}

.results-table tbody tr:hover{
  background:rgba(255,107,53,0.05);
}

.restaurante-name{
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  min-width: 150px;
}

.votos-count{
  text-align: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
  min-width: 60px;
}

/* Progress bar styles */
.progreso-cell{
  width: 350px;
  min-width: 250px;
}

.progress-bar-container{
  position: relative;
  height: 32px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,107,53,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar-fill{
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,107,53,0.4), rgba(255,107,53,0.8));
  border-radius: 8px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.progress-percentage{
  position: relative;
  z-index: 2;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
  text-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.no-results{
  text-align: center;
  color: rgba(247,250,252,0.7);
  padding: 2rem 1rem;
  font-style: italic;
}

@media (max-width:820px){
  .votaciones-content form{grid-template-columns:1fr}
  .votaciones-content{padding:1rem}
  
  .resultados-header{
    flex-direction: column;
    align-items: flex-start;
  }
  
  .total-votos-badge{
    width: 100%;
  }
  
  .resultados-info{
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ultimo-actualizado{
    width: 100%;
    display: block;
  }
  
  .progreso-cell{
    width: 100%;
    min-width: 100%;
  }
  
  .results-table th,
  .results-table td{
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width:420px){
  main{padding: calc(var(--header-height) + 0.35rem) 0.75rem 1.25rem}
  #encabezado-img{width:48px;height:48px}
  .votaciones-content{padding:0.9rem}
  .vote-button{width:100%}
  .votaciones-content .actions{justify-content:center}
}


/* Desktop: arrange image and content side-by-side and make image scale to card height */
@media (min-width:900px){
 

  .card-meta{ text-align:left }

  .botones-distri{ display:flex; gap:0.75rem; align-items:center; justify-content:flex-start }

  .caja-restaurante h3{margin-top:0}

  .boton1{max-width:260px}
}

@media (min-width:1400px){
  .caja-restaurante{grid-template-columns:35% 65%}
  .caja-restaurante #platos-imagenes{max-height:70vh}
}

.caja-restaurante h3{margin:0; color:var(--accent); font-size:1.25rem}
.caja-restaurante p{margin:0.35rem 0 0.6rem; color: rgba(247,250,252,0.9)}

.boton1{
    margin: 10px 0 0;
    width: 100%;
    max-width:200px;
    background:var(--accent);
    color:#fff;
    border:none;
    padding:0.75rem 1.2rem;
    border-radius:12px;
    font-size:1rem;
    font-weight: 600;
    cursor:pointer;
    display:inline-flex;
    gap:0.5rem;
    align-items:center;
    justify-content:center;
    transition:transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

.boton1 svg{display:inline-block}
.boton1:hover{transform:translateY(-2px); box-shadow: 0 10px 18px rgba(0,0,0,0.28)}

@media (min-width:700px){
  .caja-restaurante{grid-template-columns: 1fr 2fr; align-items:center}
  #platos-imagenes{height:220px}
}

@media (max-width:420px){
  .encabezado-inter h2{font-size:1.15rem}
}

.restaurantes-wrapper{
  width:100%;
  max-width:1200px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap:1.25rem;
  justify-content:center;
  padding:0.75rem 0.5rem 2rem;
  box-sizing:border-box;
}

/* Make sure each card is full-width in its grid cell but limited for readability */
.restaurantes-wrapper .caja-restaurante{max-width:720px; margin:0 auto}

/* Responsive tweaks */
@media (max-width:900px){
  :root{--header-height:64px}
  .restaurantes-wrapper{grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:1rem}
  .boton1{max-width:220px}
}

@media (max-width:480px){
  :root{--header-height:56px}
  main{padding: calc(var(--header-height) + 0.75rem) 0.75rem 1.25rem}
  .restaurantes-wrapper{grid-template-columns:1fr; padding:0.5rem}
  .encabezado-inter{padding:0.4rem 0.6rem}
  #encabezado-img{width:48px; height:48px}
  .encabezado-inter h2{font-size:1rem}
  .boton1{max-width:180px}
}

@media (min-width:1200px){
  .restaurantes-wrapper{grid-template-columns:repeat(2, 1fr)}
  .caja-restaurante{width:100%}
}