:root {
    --primary: #e88838;          /* Naranja DistriGo (punto i) - acción/apetito */
    --primary-dark: #cf6f22;
    --secondary: #1f4880;        /* Azul DistriGo (Distri) */
    --success: #3ba24f;          /* Verde DistriGo (Go) */
    --dark: #18181b;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-500: #71717a;
    --gray-700: #3f3f46;
    --shadow: 0 4px 12px -2px rgba(0,0,0,.08);
    --shadow-lg: 0 20px 40px -10px rgba(0,0,0,.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', system-ui, sans-serif;
    background: #fafafa;
    color: var(--dark);
    line-height: 1.5;
}

.tienda-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* HEADER */
.tienda-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}
.tienda-header .tienda-container {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.tienda-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.tienda-logo i { font-size: 1.5rem; }
.tienda-nav {
    flex: 1;
    display: flex;
    gap: 1.5rem;
}
.tienda-nav a {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
    padding: .35rem 0;
    border-bottom: 2px solid transparent;
}
.tienda-nav a.active, .tienda-nav a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.cart-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    text-decoration: none;
    font-size: 1.25rem;
    transition: all .15s;
}
.cart-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
    min-width: 20px;
    text-align: center;
}

/* HERO */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}
.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: .5rem;
    letter-spacing: -.02em;
}
.hero p {
    font-size: 1.1rem;
    opacity: .95;
}
.hero-promo {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.5rem;
    background: rgba(255,255,255,.2);
    padding: .65rem 1.25rem;
    border-radius: 30px;
    backdrop-filter: blur(8px);
    font-weight: 500;
}

/* SEARCH */
.search-bar {
    margin: 2rem 0;
    display: flex;
    gap: .5rem;
    max-width: 600px;
}
.search-bar input {
    flex: 1;
    padding: .85rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: 30px;
    font-size: 1rem;
    font-family: inherit;
    transition: all .15s;
}
.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(225,29,72,.1);
}
.search-bar button {
    padding: .85rem 1.5rem;
    background: var(--primary);
    color: white;
    border: 0;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: .95rem;
    transition: all .15s;
}
.search-bar button:hover { background: var(--primary-dark); }

/* CATEGORÍAS */
.categorias-chips {
    display: flex;
    gap: .5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.cat-chip {
    padding: .5rem 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    text-decoration: none;
    color: var(--gray-700);
    font-size: .85rem;
    font-weight: 500;
    transition: all .15s;
}
.cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.cat-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* GRID DE PRODUCTOS */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}
.producto-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}
.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.producto-img {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #fdf0e1 0%, #e8edf4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.producto-img i {
    font-size: 4rem;
    color: rgba(0,0,0,.1);
}
.producto-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.badge-agotado {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gray-700);
    color: white;
    padding: .25rem .75rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}
.producto-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.producto-marca {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
    font-weight: 600;
}
.producto-nombre {
    font-size: .95rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.3;
    flex-shrink: 0;
}
.producto-desc {
    font-size: .8rem;
    color: var(--gray-500);
    flex: 1;
}
.producto-precio {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: .25rem;
}
.btn-comprar {
    width: 100%;
    padding: .65rem;
    background: var(--dark);
    color: white;
    border: 0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: .85rem;
    transition: all .15s;
    margin-top: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}
.btn-comprar:hover:not(:disabled) {
    background: var(--primary);
}
.btn-comprar:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

/* EMPTY */
.empty {
    grid-column: 1 / -1;
    padding: 4rem 1rem;
    text-align: center;
    color: var(--gray-500);
}
.empty i {
    font-size: 4rem;
    opacity: .3;
    display: block;
    margin-bottom: 1rem;
}

/* CARRITO */
.carrito-page { padding: 2rem 0; }
.carrito-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
}
@media (max-width: 768px) {
    .carrito-grid { grid-template-columns: 1fr; }
}
.carrito-items {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.carrito-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}
.carrito-item:last-child { border-bottom: 0; }
.carrito-item-img {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fdf0e1 0%, #e8edf4 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 2rem;
    color: rgba(0,0,0,.1);
}
.carrito-item-info { flex: 1; min-width: 0; }
.carrito-item-nombre { font-weight: 600; }
.carrito-item-precio { color: var(--gray-500); font-size: .85rem; }
.carrito-item-qty {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: all .15s;
}
.qty-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.qty-input {
    width: 50px;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: .35rem;
    font-family: inherit;
}
.carrito-item-subtotal { font-weight: 700; min-width: 80px; text-align: right; }
.btn-remove {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 0;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 6px;
    transition: all .15s;
}
.btn-remove:hover { background: #fee2e2; color: #dc2626; }

.carrito-summary {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 5rem;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
}
.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-top: 2px solid var(--gray-200);
    margin-top: .5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}
.btn-checkout {
    width: 100%;
    padding: .85rem;
    background: var(--primary);
    color: white;
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    margin-top: 1rem;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: all .15s;
}
.btn-checkout:hover { background: var(--primary-dark); }

/* CHECKOUT */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
}
@media (max-width: 768px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout-form {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}
.checkout-section { margin-bottom: 2rem; }
.checkout-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-row.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    margin-bottom: .35rem;
    color: var(--gray-700);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: .9rem;
    transition: all .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(225,29,72,.1);
}

.metodo-pago-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .75rem;
}
.metodo-pago-option {
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: white;
}
.metodo-pago-option:hover { border-color: var(--primary); }
.metodo-pago-option.active {
    border-color: var(--primary);
    background: #fff1f3;
}
.metodo-pago-option i {
    font-size: 1.75rem;
    display: block;
    margin-bottom: .35rem;
    color: var(--primary);
}
.metodo-pago-option span {
    font-size: .8rem;
    font-weight: 600;
}

/* FOOTER */
.tienda-footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}
.tienda-footer h4 { font-size: 1.25rem; margin-bottom: .75rem; color: var(--secondary); }
.tienda-footer h5 { font-size: .9rem; margin-bottom: .65rem; color: var(--secondary); text-transform: uppercase; letter-spacing: .05em; }
.tienda-footer p { font-size: .85rem; margin-bottom: .35rem; }
.text-light { color: rgba(255,255,255,.7); }
.text-center { text-align: center; }
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
}
.tienda-footer hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,.1);
    margin: 1.5rem 0;
}

/* WHATSAPP FLOATING */
.whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    text-decoration: none;
    box-shadow: 0 10px 30px -5px rgba(37,211,102,.4);
    z-index: 100;
    transition: transform .2s;
}
.whatsapp-float:hover { transform: scale(1.1); }

/* SUCCESS PAGE */
.success-page {
    max-width: 600px;
    margin: 4rem auto;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}
.success-page h1 { font-size: 2rem; margin-bottom: 1rem; }
.payment-info {
    background: var(--gray-100);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    margin: 1.5rem 0;
}
.payment-info p { padding: .35rem 0; font-size: .9rem; }
.payment-info strong { color: var(--primary); }

.alert-tienda {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    font-size: .9rem;
}
.alert-tienda i { font-size: 1.25rem; flex-shrink: 0; }
.alert-tienda.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}
.alert-tienda.warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}
.alert-tienda.danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--primary);
}

/* ============================================================
   CAPA DE REFINAMIENTO "APPLE"  ·  Tienda online DistriGo
   Mismo lenguaje visual que la landing y el ERP.
   ============================================================ */
body{ letter-spacing:-.003em; }

/* Header esmerilado */
.tienda-header{
  background:rgba(255,255,255,.82);
  backdrop-filter:saturate(180%) blur(20px);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  box-shadow:0 1px 0 rgba(0,0,0,.06);
}

/* Tarjetas de producto: más redondeadas, sombra suave, hover */
.producto-card{
  border-radius:20px; border:1px solid rgba(0,0,0,.05);
  box-shadow:0 2px 14px rgba(0,0,0,.05);
  transition:transform .3s cubic-bezier(.2,.7,.2,1),box-shadow .3s;
}
.producto-card:hover{ transform:translateY(-6px); box-shadow:0 18px 40px rgba(0,0,0,.12); }
.producto-precio{ letter-spacing:-.02em; }

/* Botones tipo píldora */
.btn-comprar,.btn-checkout{
  border-radius:980px; font-weight:600;
  transition:all .25s cubic-bezier(.2,.7,.2,1);
}
.btn-comprar:hover:not(:disabled),.btn-checkout:hover{ transform:scale(1.015); }
.cart-btn{ border-radius:980px; }
.qty-btn{ border-radius:980px; }
.btn-remove{ border-radius:980px; }

/* Chips de categoría ya redondeados: refinar */
.cat-chip{ border-radius:980px; transition:all .2s; }

/* Buscador tipo píldora con foco naranja */
.search-bar input:focus{
  outline:none; border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(232,136,56,.14);
}

/* Inputs de checkout */
.checkout-form input,.checkout-form select,.checkout-form textarea{ border-radius:12px; }
.checkout-form input:focus,.checkout-form select:focus,.checkout-form textarea:focus{
  outline:none; border-color:var(--primary); box-shadow:0 0 0 4px rgba(232,136,56,.14);
}

/* Tarjetas de resumen/carrito y secciones */
.carrito-summary,.checkout-section,.carrito-item{ border-radius:18px; }

/* Hero promo un poco más suave */
.hero-promo{ border-radius:24px; }

/* Botón flotante WhatsApp con sombra de marca */
.whatsapp-float{ box-shadow:0 8px 24px -6px rgba(59,162,79,.5); }
