/* ===================== VARIABLES ===================== */
:root{
  --bg:#e6e6e6;
  --card:#fff;
  --soft:#f1f5f9;
  --primary:#b6b6b6;
  --accent:#ff5e00;
  --text:#0f172a;
  --muted:#64748b;
  --radius:16px;
  --border:#b6b6b6;
  --green:#00750a;
  --color-verde: #0f911a; 
}

/* ===================== RESET ===================== */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Inter',system-ui,sans-serif;
}

body{
  background:var(--bg);
  color:var(--text);
  min-height:100vh;
}

/* ===================== BOTONES FIJOS ===================== */
.btn_carrito,a{
  position:fixed;
  top:15px;
  z-index:9999;
  padding:.5rem 1rem;
  border-radius:2rem;
  font-size:.95rem;
  font-weight:500;
  color:#fff;
  text-decoration:none;
  transition:.2s;
}

.btn_carrito{right:15px;background:#000;cursor:pointer}
.btn_carrito:hover{background:var(--accent)}

a{left:15px;background:#007aff}
a:hover{background:var(--accent)}
a:focus-visible{outline:2px solid #007aff;outline-offset:2px}

.contador_btn_carrito{
  display:none;
  position:absolute;
  top:-5px;left:-5px;
  background:red;
  color:#fff;
  padding:4px;
  border-radius:50%;
  font-weight:700;
}

/* ===================== BACKGROUND ===================== */
.cont_img_logo_background{
  position:fixed;
  inset:0;
  display:flex;
  justify-content:center;
  align-items:center;
  opacity:.2;
  pointer-events:none;
}
.img_logo_background{width:50%;max-width:400px}

/* ===================== LAYOUT ===================== */
.contenedor_catalogo{
  display:flex;
  flex-wrap:wrap;
  gap:60px;
  padding:80px;
  justify-content:center;
  position:relative;
  z-index:1;
}

/* ===================== TARJETAS ===================== */
.tarjeta{
  width:280px;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:18px;
  background:var(--card);
  border-radius:var(--radius);
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  cursor:pointer;
  overflow:hidden;
  transition:.35s;
  animation:cardIn .8s cubic-bezier(.2,.9,.3,1) forwards;
  opacity:0;
}

.tarjeta:hover{
  transform:translateY(-8px) scale(1.02);
  box-shadow:0 20px 40px rgba(0,0,0,.25);
  border-color:var(--primary);
}

/* efecto glow */
.tarjeta::before{
  content:"";
  position:absolute;
  inset:0;
  border:1px solid var(--accent);
  background:linear-gradient(120deg,transparent,rgba(176,201,255,.18),transparent);
  opacity:0;
  transition:.4s;
}
.tarjeta:hover::before{opacity:1}

/* imagen */
.cont_tarjeta_img{
  display:flex;
  justify-content:center;
  align-items:center;
  height:160px;
}
.tarjeta_img{
  max-height:140px;
  object-fit:contain;
  transition:.5s;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.3));
}
.tarjeta:hover .tarjeta_img{
  transform:scale(1.08);
  filter:drop-shadow(0 12px 20px rgba(0,0,0,.5));
}

/* texto */
.tarjeta_titulo{
  font-size:1.3rem;
  font-weight:700;
  text-align:center;
}
.tarjeta_titulo::after{
  content:"";
  display:block;
  width:40px;height:3px;
  margin:6px auto 0;
  background:var(--primary);
  border-radius:10px;
  transition:.3s;
}
.tarjeta:hover .tarjeta_titulo::after{background:var(--accent)}

.tarjeta_medidas,
.tarjeta_descripcion{
  font-size:.85rem;
  color:var(--muted);
  text-align:center;
}

.tarjeta_detalles{
  background:var(--soft);
  padding:10px;
  border-radius:10px;
  text-align:center;
  font-size:.85rem;
}

/* descripción expandible */
.tarjeta_descripcion{
  max-height:0;
  opacity:0;
  overflow:hidden;
  transition:.4s;
}
.tarjeta:hover .tarjeta_descripcion{
  max-height:80px;
  opacity:1;
}

/* ===================== ANIMACIONES ===================== */
@keyframes cardIn{
  0%{opacity:0;transform:translateY(30px) scale(.96)}
  60%{opacity:1;transform:translateY(-4px) scale(1.01)}
  100%{opacity:1;transform:none}
}

/* delay automático */
.tarjeta{animation-delay:calc(var(--i,0)*.05s)}

/* ===================== MODAL ===================== */
#ventana_producto{
  position:fixed;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  width:900px;
  max-width:95%;
  max-height:80vh;
  display:flex;
  grid-template-columns:2fr 1fr;
  grid-template-rows:auto 1fr auto;
  background:#fff;
  border-radius:var(--radius);
  box-shadow:0 25px 60px rgba(0,0,0,.2);
  overflow:hidden;
  animation:modalIn .3s;
  flex-direction: column;
}

@keyframes modalIn{
  from{opacity:0;transform:translate(-50%,-45%) scale(.96)}
}

/* estructura modal */
.cont_ventana_titulo{grid-column:1/-1;border-bottom:1px solid #eee;text-align: center;padding: 8px;}
.cont_ventana_img{display:flex;justify-content:center;align-items:center;}
.ventana_img{max-height:200px;object-fit:contain;transition:.3s}
.ventana_img:hover{transform:scale(1.05)}

.cont_ventana_medidas,
.cont_ventana_detalles,
.cont_ventana_descripcion{
  font-size: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ventana_precio_box,
.ventana_controles,
.ventana_subtotal,
.ventana_acciones{}

.ventana_controles{
  display:flex;
  align-items:center;
  flex-direction: column;
  height: min-content;
}

.contenedor_controles{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn_cantidad{
    padding: 13px;
    border-radius: 9px;
    user-select: none;
    cursor: pointer;
}

.btn_cantidad:hover{
    background-color: var(--accent);
    color: white;
}

.in_input_cantidad{
  text-align:center;
  border:1px solid var(--border);
  border-radius:9px;
  padding: 8px;
  outline: none;
}

/* botones */
.btn_agregar{
  padding:4px;
  border-radius:8px;
  background:linear-gradient(135deg,#ff7a00,#ff9f3f);
  color:#fff;
  text-align:center;
  font-weight:600;
  cursor:pointer;
  transition:.25s;
  margin-bottom: 4px;
}
.btn_agregar:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 20px rgba(255,122,0,.3);
}

.cont_estado_agregado{
  position: absolute;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  padding: 12px;
  text-align: center;
  justify-content: center;
  text-align: center;


}

/* cerrar */
.ventana_cerrar{
  grid-column:1/-1;
  padding:4px;
  text-align:center;
  background:#ff4646;
  color:#fff;
  cursor:pointer;
  font-weight:700;
  margin-bottom: 4px;
}
.ventana_cerrar:hover{background:#fafafa;color:#000}

/* ===================== CARRITO ===================== */
.ventana_carrito{
  position:fixed;
  bottom:24px;
  right:24px;
  max-height:80vh;
  padding:20px 16px;
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:0 20px 60px rgba(0,0,0,.15);
  overflow:auto;
  animation:cartIn .3s;
}

@keyframes cartIn{
  from{opacity:0;transform:translateY(20px) scale(.96)}
}

.tarjeta_carrito{
  display:flex;
  gap:12px;
  padding:12px;
  border-radius:12px;
  background:var(--soft);
  margin-bottom:8px;
  transition:.2s;
}
.tarjeta_carrito:hover{
  background:var(--card);
  box-shadow:0 4px 12px rgba(0,0,0,.05);
}

.cont_img_tarjeta_carrito_material{
  width:52px;height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--border);
}

.img_tarjeta_carrito_material{
  width:100%;height:100%;
  object-fit:contain;
}

/* badges */
.tarjeta_carrito_elemento,
.tarjeta_carrito_cantidad_pallets{
  font-weight:700;
  color:var(--accent);
  padding:4px 12px;
  border-radius:40px;
  background:rgba(255,94,0,.08);
}

/* ===================== RESPONSIVE ===================== */
@media(max-width:768px){
  .contenedor_catalogo{padding:20px;gap:20px}
  .tarjeta{width:100%;max-width:320px}
  #ventana_producto{grid-template-columns:1fr}
}

@media(max-width:480px){
  .ventana_carrito{
    width:calc(100vw - 32px);
    right:16px;
    bottom:16px;
  }


}


.ventana_formulario_compra{
    position: fixed;
    background-color: white;
    border-radius: 8px;
    border: solid 1px var(--border-input);
    transform: translate(0%,0%);
    min-width: 500px;
    min-height: 500px;
    z-index: 9999;
}



/* ===== RESET / BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fa;
}

/* ===== VENTANA EMERGENTE (OVERLAY) ===== */
.ventana_formulario_compra {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInOverlay 0.3s ease-out;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== PANEL DEL FORMULARIO ===== */
.panel_formulario_compra {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem 2.5rem;
    max-width: 560px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.35s cubic-bezier(0.21, 1.02, 0.35, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* scroll suave */
.panel_formulario_compra::-webkit-scrollbar {
    width: 6px;
}
.panel_formulario_compra::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 10px;
}
.panel_formulario_compra::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* ===== TÍTULO ===== */
.titulo_form_compra {
    font-size: 1.6rem;
    font-weight: 600;
    color: #0b1a33;
    margin: 0 0 1.8rem 0;
    text-align: center;
    letter-spacing: -0.02em;
    border-bottom: 2px solid #eef2f6;
    padding-bottom: 0.9rem;
}

/* ===== CONTENEDORES DE CAMPOS ===== */
[class^="cont_input_"],
[class^="cont_textarea_"],
.cont_select_pago {
    margin-bottom: 1.25rem;
}

/* etiquetas (títulos) */
[class^="tittle_"] {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.3rem;
    display: block;
}

/* ===== INPUTS Y TEXTAREA ===== */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fafbfc;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.2s ease;
    outline: none;
    color: #0f172a;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: #ffffff;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    cursor: pointer;
}

select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* placeholder */
input::placeholder,
textarea::placeholder {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.9rem;
}

/* ===== BOTONES ===== */
.cont_botones_form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.cont_botones_form > div {
    flex: 1;
}

button {
    width: 100%;
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

button:active {
    transform: scale(0.97);
}

/* Botón Confirmar */
.btn_enviar_pedido {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn_enviar_pedido:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

.btn_enviar_pedido:focus-visible {
    outline: 3px solid #93bbfc;
    outline-offset: 2px;
}

/* Botón Cerrar */
.btn_cerrar_form {
    background: #f1f5f9;
    color: #1e293b;
}

.btn_cerrar_form:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .panel_formulario_compra {
        padding: 1.5rem 1.2rem;
        width: 96%;
        border-radius: 20px;
    }
    .titulo_form_compra {
        font-size: 1.3rem;
    }
    .cont_botones_form {
        flex-direction: column;
        gap: 0.75rem;
    }
    button {
        padding: 0.75rem;
    }
}

/* ===== TRANSICIÓN ADICIONAL PARA LOS CAMPOS (hover) ===== */
input:hover,
textarea:hover,
select:hover {
    border-color: #b9c8e0;
}

/* ===== ESTILO PARA EL SELECT CUANDO ESTÁ DESHABILITADO (placeholder) ===== */
select option:disabled {
    color: #94a3b8;
}