* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f2;
    color: #222;
}

a {
    color: inherit;
}

.header {
    min-height: 72px;
    padding: 0 max(4%, calc((100% - 1100px) / 2));

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: white;
    border-bottom: 1px solid #ddd;
}

.logo {
    text-decoration: none;
    font-size: 1.7rem;
    font-weight: 900;
}

.logo .agro {
    color: #d71920;
}

.logo .ya {
    color: #f26a21;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;

    font-size: 0.9rem;
    color: #555;
}

.nav a {
    text-decoration: none;
}

#nav-carrito {
    background: #d71920;
    color: white;

    padding: 8px 14px;
    border-radius: 20px;

    font-weight: bold;
}

.link-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.container {
    width: min(1100px, 92%);
    margin: 32px auto 40px;
}

.narrow {
    max-width: 760px;
}

.seccion {
    font-weight: normal;
    color: #444;
}

main h1 {
    font-size: 1.8rem;
}

.page-title p {
    margin-top: -10px;
    color: #666;
}

main h1::before,
.seccion::before {
    content: "• ";
    color: #f26a21;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.btn {
    display: inline-block;

    border: 0;
    border-radius: 8px;

    padding: 10px 16px;

    text-decoration: none;
    cursor: pointer;
}

.btn.primary {
    background: #d71920;
    color: white;
}

.btn.secondary {
    background: #ddd;
    color: #333;
}

.btn.danger {
    background: #b84040;
    color: white;
}

.btn.small {
    padding: 6px 10px;
}

.mensaje {
    margin-top: 16px;
    font-weight: bold;
}

.order-card,
.admin-order {
    background: white;

    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    padding: 20px;
    margin-bottom: 16px;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.orders-grid .order-card {
    margin-bottom: 0;
}

.order-card h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: normal;
}

.datos {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 6px;
    margin: 0;
    font-size: 0.9rem;
}

.datos dt {
    color: #666;
}

.datos dd {
    margin: 0;
}

.order-card summary {
    margin-top: 12px;
    text-align: right;
    font-size: 0.75rem;
    text-decoration: underline;
    cursor: pointer;
    list-style: none;
}

.regresar {
    display: inline-block;
    margin-top: 24px;
    font-size: 0.9rem;
    text-decoration: none;
}

.status {
    background: #eee;
    padding: 6px 12px;
    border-radius: 20px;
}

.cart-row {
    display: grid;
    grid-template-columns: 1fr 70px 70px 80px;
    align-items: center;
    gap: 12px;

    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.cart-row input {
    width: 60px;
}

.total-box {
    display: flex;
    justify-content: space-between;

    border-top: 1px solid #999;
    padding-top: 12px;
    margin: 20px 0;
}

.total-box strong {
    color: #d71920;
}

@media (max-width: 650px) {
    .header {
        padding: 16px 20px;
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
    }

    .cart-row {
        grid-template-columns: 1fr 70px 70px;
    }

    .container {
        margin-top: 24px;
    }
}
