/* ==========================================================================
   Shopping Cart - The Original Lab
   Estilos que coinciden con la estructura de cart.js
   ========================================================================== */

/* Container */
.cart-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 70vh;
}

@media (min-width: 768px) {
    .cart-container {
        padding: 3rem 2rem;
    }
}

/* Title */
.cart-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-title::before {
    content: '';
    width: 5px;
    height: 32px;
    background: linear-gradient(180deg, #2319de 0%, #1a1a2e 100%);
    border-radius: 3px;
}

@media (min-width: 768px) {
    .cart-title {
        font-size: 2.25rem;
    }
    
    .cart-title::before {
        height: 38px;
    }
}

/* Empty Cart */
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 1.5rem;
    border: 2px dashed #e2e8f0;
}

.cart-empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.cart-empty h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.cart-empty p {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #2319de 0%, #1a1a2e 100%);
    color: white !important;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none !important;
}

.btn-continue-shopping:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(35, 25, 222, 0.3);
}

/* Cart Content Grid */
.cart-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .cart-content {
        grid-template-columns: 1fr 380px;
        gap: 2rem;
    }
}

/* ==========================================================================
   Cart Items Section
   ========================================================================== */

.cart-items-section {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

@media (min-width: 768px) {
    .cart-items-section {
        padding: 1.5rem;
    }
}

#cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================================================
   Individual Cart Item - Estructura de cart.js
   ========================================================================== */

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    padding: 1.25rem;
    background: #fafafa;
    border-radius: 0.875rem;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    position: relative;
}

.cart-item:hover {
    background: #f5f5f5;
    border-color: #e5e7eb;
}

@media (min-width: 768px) {
    .cart-item {
        grid-template-columns: 100px 1fr auto auto auto;
        grid-template-rows: 1fr;
        align-items: center;
        gap: 1.25rem;
    }
}

/* Cart Item Image */
.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 0.625rem;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (min-width: 768px) {
    .cart-item-image {
        width: 100px;
        height: 100px;
    }
}

/* Cart Item Details */
.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.cart-item-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .cart-item-name {
        font-size: 1.0625rem;
    }
}

.cart-item-variants {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
}

.cart-item-variants strong {
    color: #1a1a2e;
}

.cart-item-sku {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

.cart-item-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2319de;
    margin: 0.25rem 0 0 0;
}

.cart-item-condition {
    font-size: 0.75rem;
    color: #10b981;
    margin: 0;
    font-weight: 500;
}

/* Cart Item Quantity */
.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    height: 40px;
}

.qty-btn {
    width: 40px;
    height: 100%;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #2319de;
    color: white;
}

.qty-btn:active {
    transform: scale(0.95);
}

.cart-item-quantity input[type="number"] {
    width: 50px;
    height: 100%;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    background: white;
    font-weight: 700;
    font-size: 0.9375rem;
    color: #1a1a2e;
    -moz-appearance: textfield;
}

.cart-item-quantity input[type="number"]::-webkit-outer-spin-button,
.cart-item-quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item-quantity input:focus {
    outline: none;
}

/* Cart Item Total */
.cart-item-total {
    font-size: 1.125rem;
    font-weight: 800;
    color: #1a1a2e;
    white-space: nowrap;
    display: none;
}

@media (min-width: 768px) {
    .cart-item-total {
        display: block;
        min-width: 90px;
        text-align: right;
    }
}

/* Cart Item Remove Button */
.cart-item-remove {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    background: white;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.cart-item-remove:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: scale(1.1);
}

@media (min-width: 768px) {
    .cart-item-remove {
        position: static;
        width: 36px;
        height: 36px;
        border-radius: 0.5rem;
    }
}

/* Mobile Layout Adjustments */
@media (max-width: 767px) {
    .cart-item {
        padding-right: 3rem;
    }
    
    .cart-item-quantity {
        grid-column: 1 / -1;
        width: fit-content;
    }
    
    .cart-item-price {
        font-size: 1rem;
    }
}

/* Continue Shopping Link */
.continue-shopping {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.continue-shopping a {
    color: #2319de;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.continue-shopping a:hover {
    gap: 0.75rem;
    color: #1a1a2e;
}

/* ==========================================================================
   Cart Summary - Sidebar
   ========================================================================== */

.cart-summary {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1.25rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

/* Summary Rows */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.summary-label {
    font-size: 0.9375rem;
    color: #64748b;
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* Shipping Note */
#shipping-note,
.shipping-note {
    margin: 1rem 0;
    padding: 0.875rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    color: #047857;
    text-align: center;
    font-weight: 500;
    border: 1px solid #a7f3d0;
}

/* Summary Total */
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 0 0;
    margin-top: 0.5rem;
    border-top: 2px solid #1a1a2e;
}

.summary-total .summary-label {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1a1a2e;
}

.summary-total .summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2319de;
}

/* Checkout Button */
.btn-checkout {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2319de 0%, #1a1a2e 100%);
    color: white;
    border: none;
    border-radius: 0.625rem;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(35, 25, 222, 0.35);
}

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

/* Clear Cart Button */
.btn-clear-cart {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    color: #64748b;
    border: 2px solid #e5e7eb;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.625rem;
}

.btn-clear-cart:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #475569;
}

/* ==========================================================================
   Without User State
   ========================================================================== */

.cart-container.without_user {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.without_user-wrapper {
    max-width: 450px;
    width: 100%;
    text-align: center;
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 1.25rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.without_user-icon-circle {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #2319de 0%, #1a1a2e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: white;
    box-shadow: 0 8px 25px rgba(35, 25, 222, 0.3);
}

.without_user-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.without_user-subtitle {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.without_user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.without_user-actions a {
    padding: 0.875rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none !important;
}

.without_user-divider {
    position: relative;
    margin: 1.5rem 0;
    text-align: center;
}

.without_user-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.without_user-divider span {
    position: relative;
    background: white;
    padding: 0 1rem;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 500;
}

.without_user-browse {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2319de;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.without_user-browse:hover {
    gap: 0.75rem;
    color: #1a1a2e;
}

/* ==========================================================================
   Modal Vaciar Carrito
   ========================================================================== */

.vaciar-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.vaciar-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.25s ease-out;
}

@keyframes modalSlideUp {
    from { 
        transform: translateY(20px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

.vaciar-modal-text {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
}

.vaciar-modal-buttons {
    display: flex;
    gap: 0.75rem;
}

.vaciar-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    background: transparent;
    color: #64748b;
}

.vaciar-btn-confirm {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.vaciar-btn-confirm:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.vaciar-btn-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1023px) {
    .cart-summary {
        position: static;
    }
}

@media (max-width: 600px) {
    .cart-container {
        padding: 1.5rem 1rem;
    }
    
    .cart-title {
        font-size: 1.5rem;
    }
    
    .cart-items-section {
        padding: 1rem;
    }
    
    .cart-item {
        padding: 1rem;
        padding-right: 2.5rem;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-name {
        font-size: 0.9375rem;
    }
    
    .without_user-wrapper {
        padding: 2rem 1.5rem;
    }
    
    .without_user-icon-circle {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    .without_user-title {
        font-size: 1.25rem;
    }
    
    .vaciar-modal-buttons {
        flex-direction: column;
    }
}