// Estilos para Catálogo de Servicios - Grupo 5
// Catálogo moderno con filtrado, búsqueda y carrito

/* Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    margin: 0;
}

/* Navbar (reutilizado) */
.navbar {
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand h1 {
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-logout {
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-1px);
}

.navbar-user {
    font-weight: 500;
    margin-left: 2rem;
}

/* Contenido Principal */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.catalog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.catalog-header h1 {
    margin: 0;
    color: #1976d2;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.catalog-header p {
    margin: 0.5rem 0 0;
    color: #666;
    font-size: 1.1rem;
}

/* Filtros */
.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f5f5f5;
    border: 2px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: #e8f0fe;
    border-color: #1976d2;
}

.filter-btn.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.sort-dropdown select {
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: #1976d2;
}

/* Grid de Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.service-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.service-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    position: relative;
}

.service-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.service-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-header {
    margin-bottom: 1rem;
}

.service-title {
    margin: 0 0 0.5rem;
    color: #333;
    font-size: 1.2rem;
}

.service-category {
    color: #1976d2;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.service-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.service-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-weight: 600;
}

.service-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1976d2;
    text-align: center;
    margin: 1rem 0;
}

.service-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-add-cart {
    background: #4caf50;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-cart:hover {
    background: #43a047;
    transform: translateY(-1px);
}

.btn-details {
    background: #757575;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-details:hover {
    background: #616161;
    transform: translateY(-1px);
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state h3 {
    color: #666;
    margin: 0 0 1rem;
}

.empty-state p {
    color: #999;
    margin: 0;
}

/* Botón flotante del carrito */
.cart-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1976d2;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 99;
}

.cart-floating-btn:hover {
    background: #115293;
    transform: scale(1.1);
}

.cart-icon {
    font-size: 1.5rem;
}

.cart-count {
    background: #f44336;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Sidebar del Carrito */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 16px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 101;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    color: #1976d2;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #1976d2;
}

.cart-items {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.empty-cart p {
    margin: 0 0 1rem;
}

.cart-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #333;
}

.cart-item-price {
    color: #1976d2;
    font-weight: 700;
}

.cart-item-remove {
    background: #f44336;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 2px solid #f0f0f0;
    background: white;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-total span:last-child {
    color: #1976d2;
    font-size: 1.3rem;
}

.btn-block {
    width: 100%;
}

/* Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .filters-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-filters {
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .cart-floating-btn {
        bottom: 1rem;
        right: 1rem;
    }
    
    .service-price {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .category-filters {
        overflow-x: auto;
        white-space: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .service-actions {
        grid-template-columns: 1fr;
    }
    
    .cart-floating-btn {
        width: 50px;
        height: 50px;
        font-size: 0.9rem;
    }
    
    .cart-icon {
        font-size: 1.2rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.service-card {
    animation: fadeIn 0.4s ease-out;
}
