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

:root {
    --primary-color: #ff6b35;
    --secondary-color: #2c3e50;
    --accent-color: #f39c12;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background: #fafafa;
    --card-shadow: 0 8px 25px rgba(0,0,0,0.1);
    --border-radius: 15px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #ecf0f1 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #e74c3c 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
    background: #fff;
}

.restaurant-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cart-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cart-container:hover {
    transform: scale(1.1);
}

.cart-icon {
    background: rgba(255,255,255,0.25);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 22px;
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-icon:hover {
    background: rgba(255,255,255,0.4);
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Hero Banner */
.hero-banner {
    width: 100%;
    height: 250px;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)),
                url('imagenes/header-banner.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    padding: 20px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 20px;
    font-weight: 300;
    opacity: 0.9;
}

/* Menu Container */
.menu-container {
    padding: 30px 25px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.category-section {
    margin-bottom: 50px;
}

.category-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.item-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    max-width: 420px;
}

.item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.item-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #ddd, #eee);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    aspect-ratio: 4 / 3;
}

.item-card:hover .item-image img {
    transform: scale(1.05);
}

.item-image-placeholder {
    font-size: 64px;
    color: #999;
}

.item-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.1) 50%, transparent 51%);
    animation: shimmer 2s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.item-info {
    padding: 20px;
}

.item-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.item-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.4;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.add-btn {
    background: linear-gradient(135deg, var(--primary-color), #e74c3c);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    font-size: 14px;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

/* Modal Styles */
.cart-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

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

.cart-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--primary-color);
}

.cart-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 25px;
    text-align: center;
}

/* Delivery Form */
.delivery-form h3, .cart-summary h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.continue-btn, .edit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), #e74c3c);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.continue-btn:hover, .edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.delivery-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.delivery-info p {
    margin-bottom: 5px;
    font-size: 14px;
}

#cart-items {
    list-style: none;
    margin-bottom: 25px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.cart-item:hover {
    background: #e9ecef;
}

.item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    line-height: 1;
}

.remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.cart-total {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
}

.payment-section {
    margin-bottom: 25px;
}

.payment-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
    display: block;
}

#payment-method {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

#payment-method:focus {
    outline: none;
    border-color: var(--primary-color);
}

.order-btn {
    width: 100%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-cart-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }

    .restaurant-name {
        font-size: 18px;
    }

    .logo {
        width: 35px;
        height: 35px;
        margin-right: 10px;
    }

    .cart-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .hero-banner {
        height: 160px;
        margin-top: 60px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .menu-container {
        padding: 15px 10px;
    }

    .category-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 15px;
    }

    .item-card {
        display: flex;
        flex-direction: column;
        max-width: none;
    }

    /* Make cards more compact on mobile */
    .item-image {
        height: 150px;
    }

    .item-info {
        padding: 12px;
    }

    .item-name {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .item-description {
        font-size: 13px;
        margin-bottom: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .item-footer {
        margin-top: auto;
    }

    .item-price {
        font-size: 16px;
    }

    .add-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hero-banner {
        height: 120px;
    }

    .hero-title {
        font-size: 22px;
    }
    
    /* Even more compact for very small screens */
    .items-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Horizontal card layout for mobile to save vertical space */
    .item-card {
        flex-direction: row;
        align-items: center;
        height: auto;
        min-height: 100px;
    }

    .item-image {
        width: 100px;
        height: 100%;
        min-height: 110px; /* Ensure it covers the card height */
        flex-shrink: 0;
    }

    .item-info {
        flex: 1;
        padding: 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .item-name {
        font-size: 15px;
    }

    .item-description {
        display: none; /* Hide description on very small screens to save space? Or truncate more? Let's hide for compactness as requested "amontonado" */
    }

    .item-footer {
        margin-top: 5px;
        justify-content: space-between;
        width: 100%;
    }
    
    .add-btn {
        padding: 6px 12px;
    }
}
/* Toast (cliente) */
.toast-wrap{
  position:fixed;
  top:16px;
  right:16px;
  z-index:9999;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.toast{
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  font-size:14px;
  max-width:320px;
}
.toast.ok{background:#111827}
.toast.err{background:#7f1d1d}
.hint{color:rgba(17,24,39,.7);font-size:13px;margin-top:6px}

.qty-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  height:24px;
  padding:0 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:rgba(17,24,39,.08);
  color:#111827;
  margin-left:10px;
}

/* =====================
   Carrito (filas con cantidad al lado)
   ===================== */
.cart-row{
  display:grid;
  grid-template-columns: 1fr auto auto auto;
  align-items:center;
  gap:12px;
  padding:12px 10px;
  border:1px solid rgba(17,24,39,.08);
  border-radius:14px;
  margin-bottom:10px;
}
.cart-row-title{font-weight:800;color:var(--secondary-color)}
.cart-row-sub{font-size:12px;color:var(--text-light);margin-top:2px}
.cart-row-qty{
  display:flex;
  align-items:center;
  gap:8px;
  background:rgba(17,24,39,.04);
  border:1px solid rgba(17,24,39,.08);
  padding:6px 8px;
  border-radius:999px;
}
.qty-btn{
  width:32px;
  height:32px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.15);
  background:#fff;
  font-weight:900;
  cursor:pointer;
}
.qty-btn:hover{border-color:var(--primary-color)}
.qty-val{min-width:18px;text-align:center;font-weight:900;color:var(--secondary-color)}
.cart-row-total{font-weight:900;color:var(--secondary-color)}
.cart-row-remove{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(239,68,68,.35);
  background:rgba(239,68,68,.08);
  color:#b91c1c;
  font-weight:900;
  cursor:pointer;
}
.cart-row-remove:hover{background:rgba(239,68,68,.14)}

@media (max-width:520px){
  .cart-row{grid-template-columns: 1fr auto; grid-template-areas:
    "main remove"
    "qty total";
  }
  .cart-row-main{grid-area:main}
  .cart-row-remove{grid-area:remove; justify-self:end}
  .cart-row-qty{grid-area:qty}
  .cart-row-total{grid-area:total; justify-self:end}
}

/* =====================
   Modal de producto: cantidad junto al precio
   ===================== */
.product-modal-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
}
.quantity-inline{margin:0}

/* Payment reference hint */
.payment-reference-hint{
  margin-top:10px;
  padding:10px 14px;
  background:linear-gradient(135deg, #eef6ff, #e8f4fd);
  border:1px solid #b3d4fc;
  border-radius:10px;
  color:#1a56db;
  font-size:14px;
  font-weight:600;
}
