/* ============================================
   CARRITO DE COMPRAS - Medi/Flores
   Navbar actions, toast y página completa
   ============================================ */

/* --- Nav Actions Wrapper (inside collapse) --- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 10px;
}

/* --- Base action button (cart, login, user) --- */
.nav-action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 22px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    font-family: "poppins", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.nav-action-btn:hover,
.nav-action-btn:focus {
    border-color: #3cff3c;
    color: #3cff3c;
    background: rgba(60, 255, 60, 0.08);
    text-decoration: none;
}

.nav-action-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
    transition: fill 0.3s ease;
}

/* --- Cart button specific --- */
.nav-cart-btn {
    border-radius: 0;
    border-right: none;
}

/* --- Login button specific --- */
.nav-login-btn {
    border-radius: 0;
    background: rgba(60, 255, 60, 0.12);
    border-color: #3cff3c;
    color: #3cff3c;
}

.nav-login-btn:hover,
.nav-login-btn:focus {
    background: #00ff00;
    border-color: #00ff00;
    color: #ffffff;
}

/* --- User button specific --- */
.nav-user-btn {
    border-radius: 0;
}

/* --- Auth container --- */
.nav-auth-container {
    position: relative;
}

/* --- Cart Badge --- */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #00ff00;
    color: #1a1a1a;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "poppins", sans-serif;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
}

.cart-badge.bump {
    transform: scale(1.35);
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
    display: none;
}

/* --- Botón "Agregar al carrito" en tarjetas de producto --- */
.btn-add-cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: transparent;
    color: #3cff3c;
    border: 1.5px solid #3cff3c;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "poppins", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.btn-add-cart:hover {
    background: #00ff00;
    border-color: #00ff00;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

.btn-add-cart svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* --- Toast de notificación --- */
.cart-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1a1a1a;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    z-index: 100002;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "poppins", sans-serif;
    border-left: 3px solid #00ff00;
}

.cart-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-toast svg {
    width: 20px;
    height: 20px;
    fill: #3cff3c;
    flex-shrink: 0;
}

/* ============================================
   PÁGINA COMPLETA DEL CARRITO
   ============================================ */

.cart-page-section {
    padding: 40px 0 75px;
}

/* --- Tarjetas de items --- */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border-radius: 0;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
    border-left: 3px solid transparent;
}

.cart-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left-color: #00ff00;
}

.cart-card-img {
    width: 90px;
    height: 90px;
    border-radius: 0;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

.cart-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-card-info {
    flex: 1;
    min-width: 0;
}

.cart-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #2d8a00;
    margin: 0;
}

.cart-card-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cart-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 0;
    border: 1.5px solid #e0e0e0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #555;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.cart-qty-btn:hover {
    border-color: #00ff00;
    color: #2d8a00;
    background: #f0fff0;
}

.cart-qty-value {
    width: 44px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.cart-card-subtotal {
    text-align: right;
    flex-shrink: 0;
    min-width: 100px;
}

.cart-card-subtotal-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.cart-card-subtotal-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 2px 0 0;
}

.cart-card-remove {
    flex-shrink: 0;
}

.cart-card-remove button {
    width: 38px;
    height: 38px;
    border-radius: 0;
    border: 1.5px solid #f0f0f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.cart-card-remove button:hover {
    background: #fff0f0;
    border-color: #ffaaaa;
}

.cart-card-remove button svg {
    width: 16px;
    height: 16px;
    fill: #cc3333;
}

/* --- Resumen del pedido --- */
.cart-page-summary {
    background: #ffffff;
    border-radius: 0;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 30px;
    border-top: 3px solid #00ff00;
}

.cart-page-summary h4 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px 0;
    color: #1a1a1a;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f0;
    font-family: "poppins", sans-serif;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
}

.cart-summary-row.total {
    border-top: 2px solid #f0f0f0;
    margin-top: 12px;
    padding-top: 18px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: transparent;
    color: #00ff00;
    border: 1.5px solid #00ff00;
    border-radius: 0;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "poppins", sans-serif;
    text-align: center;
    text-decoration: none;
    margin-top: 20px;
}

.cart-checkout-btn:hover {
    background: #00ff00;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.3);
    text-decoration: none;
}

.cart-clear-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: none;
    color: #999;
    border: 1.5px solid #eee;
    border-radius: 0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    font-family: "poppins", sans-serif;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-clear-btn:hover {
    color: #cc3333;
    border-color: #ffaaaa;
    background: #fff5f5;
}

/* --- Estado vacío del carrito --- */
.cart-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.cart-empty-state svg {
    width: 100px;
    height: 100px;
    fill: #e0e0e0;
    margin-bottom: 24px;
}

.cart-empty-state h3 {
    font-size: 22px;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    font-family: "poppins", sans-serif;
}

.cart-empty-state p {
    color: #aaa;
    font-size: 15px;
    margin-bottom: 28px;
}

/* --- Auth required state --- */
.cart-auth-state {
    text-align: center;
    padding: 60px 20px;
}

.cart-auth-state svg {
    width: 80px;
    height: 80px;
    fill: #e0e0e0;
    margin-bottom: 24px;
}

.cart-auth-state h3 {
    font-size: 22px;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    font-family: "poppins", sans-serif;
}

.cart-auth-state p {
    color: #aaa;
    font-size: 15px;
    margin-bottom: 28px;
}

/* --- Responsive --- */

/* Tablet: collapse navbar (Bootstrap lg breakpoint = 992px) */
@media (max-width: 992px) {
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-top: 15px;
    }

    .nav-action-btn {
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-cart-btn {
        border-right: none;
    }

    .nav-action-btn:last-child,
    .nav-auth-container .nav-action-btn {
        border-bottom: none;
    }

    .nav-login-btn {
        background: transparent;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: #3cff3c;
    }

    .nav-login-btn:hover,
    .nav-login-btn:focus {
        background: rgba(60, 255, 60, 0.08);
        color: #3cff3c;
    }

    .cart-badge {
        position: static;
        min-width: 22px;
        height: 22px;
        margin-left: 8px;
    }

    .nav-user-dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none;
        border-radius: 0;
        display: none;
        margin-top: 0;
    }

    .nav-user-dropdown.show {
        display: block;
    }
}

@media (max-width: 768px) {
    .cart-card {
        flex-wrap: wrap;
        gap: 14px;
    }

    .cart-card-img {
        width: 70px;
        height: 70px;
    }

    .cart-card-subtotal {
        text-align: left;
        min-width: auto;
    }

    .cart-card-controls {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 8px;
        border-top: 1px solid #f0f0f0;
    }

    .cart-page-section {
        padding: 25px 0 50px;
    }
}

@media (max-width: 575px) {
    .cart-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        font-size: 13px;
    }

    .cart-card {
        padding: 14px;
    }

    .cart-card-name {
        font-size: 14px;
    }

    .cart-card-price,
    .cart-card-subtotal-value {
        font-size: 15px;
    }
}
