:root {
  --principal: #2d5f2e;
  --secundario: #ff8c42;
  --terciario: #f0f4f0;
  --blanco: #ffffff;
  --oscuro: #000000;
  --sombra: #5a6d5a;
  --sombra2: #dde4dd;
}

/* =========================
   RESPONSIVE GLOBAL PROYECTO
========================= */


/* ===== TABLET ===== */
@media (max-width: 1024px) {

  /* HEADER */
  header {
    padding: 0 40px;
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  h1 {
    font-size: 42px;
  }

  nav {
    padding: 10px 40px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  /* CONTENEDORES */
  .catalogo,
  .contenedor-blog {
    padding: 40px;
  }

  /* GRIDS */
  .productos-disp,
  .blog-grid,
  .cards {
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
    gap: 20px;
  }

  /* TABLAS / PÁGINAS */
  .encargos-page,
  .historial-page,
  .prod-page {
    padding: 20px;
  }
}


/* ===== MOBILE ===== */
@media (max-width: 768px) {

  /* HEADER */
  header {
    flex-direction: column;
    padding: 15px;
    gap: 10px;
    text-align: center;
    position: relative;
  }

  h1 {
    font-size: 28px;
  }

  .logo_cole,
  .logo_agro {
    width: 70px;
  }

  /* =========================
     BOTÓN HAMBURGUESA
  ========================= */

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;

    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2001;

    width: 50px;
    height: 50px;

    border: none;
    border-radius: 14px;

    background: rgba(45, 95, 46, 0.9);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    cursor: pointer;

    transition: 0.3s ease;
  }

  .menu-toggle span {
    position: absolute;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 10px;
    transition: 0.3s ease;
  }

  .menu-toggle span:nth-child(1) {
    transform: translateY(-8px);
  }

  .menu-toggle span:nth-child(2) {
    opacity: 1;
  }

  .menu-toggle span:nth-child(3) {
    transform: translateY(8px);
  }

  /* ANIMACIÓN ☰ → ✖ */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
  }

  /* =========================
     NAV MOBILE PREMIUM
  ========================= */

  nav {
    position: fixed;
    top: 0;
    left: -100%;

    width: 75%;
    height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 20px;

    background: rgba(255, 255, 255, 0.82);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    box-shadow: 5px 0 30px rgba(0,0,0,0.15);

    transition: 0.4s ease;

    z-index: 2000;
  }

  nav.active {
    left: 0;
  }

  nav a {
    width: 80%;

    text-align: center;

    padding: 15px;

    border-radius: 14px;

    font-size: 18px;
    font-weight: 500;

    text-decoration: none;

    color: var(--oscuro);

    transition: 0.3s ease;
  }

  nav a:hover {
    background: var(--principal);
    color: white;
    transform: scale(1.03);
  }

  /* HERO */
  .contenido {
    margin-left: 0;
    padding: 40px 20px;
    text-align: center;
    max-width: 100%;
  }

  .contenido h1 {
    font-size: 26px;
  }

  .contenido p {
    font-size: 14px;
  }

  .overlay {
    justify-content: center;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 12px;
  }

  /* GRIDS */
  .productos-disp,
  .blog-grid,
  .cards {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  /* BLOG DETALLE */
  .blog-detalle-layout {
    flex-direction: column;
    padding: 20px;
  }

  .blog-detalle-sidebar {
    position: relative;
    top: auto;
  }

  /* PRODUCTO DETALLE */
  .detalle-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .detalle-info h1 {
    font-size: 36px;
  }

  /* ADMIN */
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .content {
    margin-left: 0;
    width: 100%;
  }

  /* TABLAS */
  .tabla-container {
    overflow-x: auto;
  }
}


/* ===== MOBILE PEQUEÑO ===== */
@media (max-width: 480px) {

  h1 {
    font-size: 26px;
  }

  .contenido h1 {
    font-size: 24px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .producto-disp {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .producto-info-disp {
    margin-left: 0;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
}


/* ===== LOGIN RESPONSIVE ===== */
@media (max-width: 768px) {

  .login-container {
    padding: 20px;
  }

  .login-card {
    width: 100%;
    max-width: 100%;
    padding: 25px;
  }

  .login-card h2 {
    font-size: 22px;
  }

  .login-card input {
    font-size: 14px;
  }

  .login-card button {
    font-size: 14px;
    padding: 12px;
  }

  .volver {
    position: relative;
    top: 0;
    left: 0;
    display: inline-block;
    margin: 15px;
  }
}