/* ═══════════════════════════════════════════════════════════════════════════
   REPARACIONES GUILLÉN - CART & PRODUCTS STYLES
   Additional styles for e-commerce functionality
═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   CART TOGGLE BUTTON
═══════════════════════════════════════════════════════════════════════════ */
.cart-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.3s var(--ease-smooth);
}

.cart-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.cart-toggle svg {
    width: 20px;
    height: 20px;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.3s var(--ease-bounce);
}

.cart-count.pulse {
    animation: cartPulse 0.4s var(--ease-bounce);
}

@keyframes cartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CART SIDEBAR
═══════════════════════════════════════════════════════════════════════════ */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-smooth);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-out);
}

.cart-sidebar.active {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.cart-header h3 svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-primary);
}

.cart-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.cart-close:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.cart-close svg {
    width: 18px;
    height: 18px;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.cart-empty svg {
    width: 60px;
    height: 60px;
    stroke: var(--text-muted);
    margin-bottom: 1.5rem;
}

.cart-empty p {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-empty span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.cart-item:hover {
    border-color: var(--border-light);
}

.cart-item-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--img-filter);
}

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

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-sku {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.cart-item-qty span {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    min-width: 24px;
    text-align: center;
}

.cart-item-remove {
    align-self: flex-start;
    padding: 0.25rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.cart-item-remove:hover {
    color: #e53935;
}

.cart-item-remove svg {
    width: 18px;
    height: 18px;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: none;
}

.cart-footer.visible {
    display: block;
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-summary span {
    color: var(--text-secondary);
}

.cart-summary strong {
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.cart-note {
    margin-bottom: 1.5rem;
}

.cart-note label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cart-note textarea {
    width: 100%;
    padding: 0.75rem;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.cart-note textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-whatsapp {
    width: 100%;
    justify-content: center;
    background: #25D366;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.btn-whatsapp:hover {
    background: #128C7E;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.cart-clear {
    width: 100%;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER SECTION
═══════════════════════════════════════════════════════════════════════════ */
.filter-section {
    padding: 2rem 3rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.6rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s var(--ease-smooth);
}

.filter-tab:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
}

.filter-info {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCTS GRID
═══════════════════════════════════════════════════════════════════════════ */
.products-section {
    background: var(--bg-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.4s var(--ease-smooth);
}

.product-card:hover {
    border-color: var(--border-light);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card.hidden {
    display: none;
}

.product-card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: var(--img-filter);
    transition: transform 0.4s var(--ease-smooth);
}

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

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
}

.product-badge.featured {
    background: var(--accent-primary);
}

.product-badge.new {
    background: #2196F3;
}

.product-badge.sale {
    background: #4CAF50;
}

.product-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-sku {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.product-stock {
    font-size: 0.7rem;
    font-weight: 500;
}

.product-stock.in-stock {
    color: #4CAF50;
}

.product-stock.low-stock {
    color: #FF9800;
}

.product-stock.out-of-stock {
    color: #e53935;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.product-price {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.add-to-cart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    transition: all 0.3s var(--ease-smooth);
}

.add-to-cart-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

.add-to-cart-btn.added {
    background: #4CAF50;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   INFO BANNER
═══════════════════════════════════════════════════════════════════════════ */
.info-banner {
    background: var(--bg-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.info-card {
    text-align: center;
    padding: 2rem 1rem;
}

.info-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border: 1px solid rgba(255, 87, 34, 0.2);
}

.info-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-primary);
}

.info-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.info-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-bounce);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast svg {
    width: 20px;
    height: 20px;
    stroke: #4CAF50;
}

.toast span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .products-grid,
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-section {
        padding: 1.5rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }

    .filter-tab {
        white-space: nowrap;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .cart-sidebar {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}