/* ─── TIPOGRAFÍA ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

/* ─── HERO ───────────────────────────────────────────────── */
.carr-hero {
    background: var(--navy);
    padding: 36px 0 32px;
    text-align: center;
}

.carr-hero__title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--white);
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

.carr-hero__sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Montserrat', sans-serif;
}

/* ─── SECCIÓN PRINCIPAL ──────────────────────────────────── */
.carr-section {
    padding: 48px 0 80px;
    background: #f5f5f5;
    min-height: 60vh;
}

/* ─── AJUSTES DESKTOP (centrado + aire lateral) ─────────── */
@media (min-width: 901px) {
    .carr-hero .container,
    .carr-section .container {
        width: 100%;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ─── ESTADO VACÍO ───────────────────────────────────────── */
.carr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.carr-empty__icon {
    width: 96px;
    height: 96px;
    background: rgba(0, 48, 78, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.carr-empty__icon svg {
    width: 44px;
    height: 44px;
    stroke: var(--navy);
    opacity: 0.4;
}

.carr-empty__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

.carr-empty__text {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 32px;
    font-family: 'Montserrat', sans-serif;
    max-width: 300px;
}

/* ─── BOTÓN PRIMARIO (Ir a la tienda) ───────────────────── */
.carr-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--navy);
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 100px;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.2s, transform 0.2s;
}

.carr-btn-primary svg {
    width: 16px;
    height: 16px;
    stroke: var(--gold);
    fill: none;
    stroke-width: 2;
}

.carr-btn-primary:hover {
    background: #004a78;
    transform: translateY(-2px);
}

/* ─── LAYOUT DE DOS COLUMNAS ─────────────────────────────── */
.carr-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

.carr-col { display: flex; flex-direction: column; gap: 20px; }

/* ─── CARD GENÉRICA ──────────────────────────────────────── */
.carr-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 48, 78, 0.08);
    overflow: hidden;
}

.carr-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.carr-card__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--navy);
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

/* Cuando el título va directo dentro de la card (sin header) */
.carr-card--resumen .carr-card__title,
.carr-card--form .carr-card__title {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    display: block;
    margin: 0;
}

/* ─── BOTÓN VACIAR CARRITO ───────────────────────────────── */
.carr-btn-vaciar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1.5px solid rgba(220, 53, 69, 0.4);
    color: #dc3545;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: 100px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
}

.carr-btn-vaciar svg {
    width: 13px;
    height: 13px;
    stroke: #dc3545;
    fill: none;
    stroke-width: 2;
}

.carr-btn-vaciar:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.carr-btn-vaciar:hover svg { stroke: #fff; }

/* ─── LISTA DE ITEMS ─────────────────────────────────────── */
.carr-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.carr-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    animation: fadeSlideIn 0.3s ease;
}

.carr-item:last-child { border-bottom: none; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Imagen del item */
.carr-item__img-wrap {
    width: 72px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.carr-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carr-item__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carr-item__img-placeholder svg {
    width: 28px;
    height: 28px;
    stroke: #ccc;
    fill: none;
    stroke-width: 1.5;
}

/* Info del item */
.carr-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.carr-item__nombre {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Montserrat', sans-serif;
}

.carr-item__talle {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--navy);
    background: rgba(0, 48, 78, 0.08);
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
    font-family: 'Montserrat', sans-serif;
}

.carr-item__precio-unit {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
    font-family: 'Montserrat', sans-serif;
}

.carr-item__precio-normal {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.35);
    font-family: 'Montserrat', sans-serif;
    display: inline-block;
    text-decoration-line: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(0, 0, 0, 0.35);
}

.carr-item__subtotal {
    font-size: 14px;
    font-weight: 800;
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
    margin-top: 2px;
}

/* Controles de cantidad */
.carr-item__controles {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.carr-item__cantidad-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid rgba(0, 48, 78, 0.15);
    border-radius: 100px;
    overflow: hidden;
}

.carr-item__btn-cant {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
    transition: background 0.15s;
    font-family: 'Montserrat', sans-serif;
}

.carr-item__btn-cant:hover { background: rgba(0, 48, 78, 0.07); }

.carr-item__cant-num {
    width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
}

.carr-item__btn-eliminar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(0, 0, 0, 0.3);
    transition: color 0.2s, transform 0.2s;
}

.carr-item__btn-eliminar svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.carr-item__btn-eliminar:hover {
    color: #dc3545;
    transform: scale(1.2);
}

/* ─── RESUMEN ────────────────────────────────────────────── */
.carr-resumen-lineas {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.carr-resumen-linea {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
}

.carr-resumen-linea__nombre {
    color: rgba(0, 0, 0, 0.6);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carr-resumen-linea__precio {
    font-weight: 700;
    color: var(--navy);
}

.carr-resumen-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.carr-resumen-total__label {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
}

.carr-resumen-total__valor {
    font-size: 20px;
    font-weight: 900;
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
}

/* ─── FORMULARIO ─────────────────────────────────────────── */
.carr-form {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.carr-form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.carr-form__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
}

.carr-form__input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid rgba(0, 48, 78, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    color: var(--navy);
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.carr-form__input::placeholder { color: rgba(0, 0, 0, 0.3); }

.carr-form__input:focus {
    border-color: var(--navy);
    background: var(--white);
}

.carr-form__input.error { border-color: #dc3545; }

.carr-form__error {
    font-size: 11px;
    color: #dc3545;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    min-height: 16px;
}

/* ─── BOTÓN PEDIDO POR WHATSAPP ──────────────────────────── */
.carr-btn-pedido {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: #25D366;
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.carr-btn-pedido svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.carr-btn-pedido:hover {
    background: #1ebe5d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.carr-btn-pedido:active { transform: translateY(0); }

.carr-btn-pedido.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.carr-form__nota {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.4);
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
}

/* ─── HISTORIAL DE COMPRAS (cliente) ─────────────────────── */
.carr-history {
    width: min(720px, 100%);
    margin-top: 28px;
}

.carr-card--history {
    width: 100%;
}

.carr-history__list {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.carr-history-order {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fafafa;
}

.carr-history-order__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.carr-history-order__fecha {
    font-size: 12px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.55);
    font-family: 'Montserrat', sans-serif;
}

.carr-history-order__total {
    font-size: 13px;
    font-weight: 900;
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
}

.carr-history-order__meta {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.55);
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 10px;
}

.carr-history-order__items {
    margin: 0;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carr-history-order__items li {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.65);
    font-family: 'Montserrat', sans-serif;
}

/* ─── TOAST (notificación) ───────────────────────────────── */
.carr-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--navy);
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 9999;
    max-width: 280px;
}

.carr-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .carr-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .carr-hero { padding: 28px 0 24px; }
    .carr-section { padding: 24px 0 60px; }

    .carr-item {
        grid-template-columns: 60px 1fr auto;
        gap: 12px;
        padding: 14px 16px;
    }

    .carr-item__img-wrap {
        width: 60px;
        height: 72px;
    }

    .carr-item__nombre { font-size: 13px; }

    .carr-card__header { padding: 16px 16px 12px; }
    .carr-card--resumen .carr-card__title,
    .carr-card--form .carr-card__title { padding: 16px 16px 12px; }

    .carr-resumen-lineas { padding: 12px 16px; }
    .carr-resumen-total { padding: 12px 16px; }
    .carr-form { padding: 12px 16px 20px; }

    .carr-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}