* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.search-form button {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.carrito-link {
    padding: 12px 24px;
    background: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.producto-card {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    background: #f9f9f9;
}

.producto-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.add-to-cart-form {
    margin-top: 15px;
}

.quantity-control {
    margin: 10px 0;
}

.quantity-control input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.add-to-cart-form button {
    width: 100%;
    padding: 10px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.cart-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-danger {
    background: #e74c3c;
}

.btn-primary {
    background: #2ecc71;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.cart-table th, .cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cart-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.quantity-input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.quantity-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    outline: none;
}

.quantity-input.updating {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.btn-remove {
    color: #e74c3c;
    text-decoration: none;
    font-size: 18px;
}

.cart-totals {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    max-width: 400px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.total-row.total {
    font-size: 18px;
    border-top: 2px solid #3498db;
    margin-top: 10px;
    padding-top: 15px;
}

.order-form {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-note {
    margin-top: 15px;
    font-style: italic;
    color: #666;
}

.success-message {
    text-align: center;
    padding: 50px 20px;
}

.order-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
    display: inline-block;
}

.success-text {
    font-size: 18px;
    color: #2ecc71;
    margin: 20px 0;
}

.instructions {
    margin-top: 40px;
    padding: 20px;
    background: #e8f4fc;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.empty-cart {
    text-align: center;
    padding: 50px 20px;
}

.empty-cart p {
    font-size: 18px;
    margin-bottom: 20px;
}

.no-results {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* Añadir al final del archivo existente */

/* Estilos para filtros */
.filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
}

.filter-group input[type="text"] {
    width: 100%;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn.clear-filters {
    background-color: #95a5a6;
}

.btn.clear-filters:hover {
    background-color: #7f8c8d;
}

.marca-tag {
    display: inline-flex;
    align-items: center;
    background-color: #3498db;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.marca-tag a {
    color: white;
    margin-left: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

.active-filters {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.active-filters h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Estilos para tarjetas de producto mejoradas */
.producto-card {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    background: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.producto-header {
    margin-bottom: 15px;
}

.marca-indicator {
    display: inline-block;
    background-color: #e8f4fc;
    color: #3498db;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.producto-info {
    flex-grow: 1;
    margin-bottom: 15px;
}

.btn-add {
    width: 100%;
    padding: 12px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-add:hover {
    background: #27ae60;
}

.btn-icon {
    font-size: 18px;
}

/* Mensaje de bienvenida */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin: 30px 0;
}

.welcome-message h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.welcome-message p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Grid de marcas */
.marcas-grid {
    max-width: 800px;
    margin: 0 auto;
}

.marcas-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.marca-card {
    display: block;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.marca-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.4);
}

.marca-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.marca-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    color: #667eea;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
}

.marca-name {
    flex-grow: 1;
    margin-left: 15px;
    font-size: 16px;
    font-weight: 500;
}

.marca-arrow {
    opacity: 0.7;
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .carrito-link {
        text-align: center;
        margin-top: 10px;
    }
    
    .marcas-list {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .productos-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-message h2 {
        font-size: 24px;
    }
    
    .welcome-message p {
        font-size: 16px;
    }
}

/* Añadir estos estilos al archivo existente */

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0 30px;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination a, 
.pagination span {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #3498db;
    font-size: 16px;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.pagination a:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
}

.pagination .active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: bold;
    cursor: default;
}

.pagination .disabled {
    color: #bdc3c7;
    cursor: not-allowed;
    border-color: #ecf0f1;
    background-color: #f8f9fa;
}

.pagination .disabled:hover {
    background-color: #f8f9fa;
    color: #bdc3c7;
    border-color: #ecf0f1;
    transform: none;
    box-shadow: none;
}

.pagination-info {
    text-align: center;
    margin: 20px 0;
    color: #7f8c8d;
    font-size: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.results-summary {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.results-summary h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 20px;
}

.results-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.total-results {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    background-color: #e8f4fc;
    padding: 8px 15px;
    border-radius: 6px;
}

.current-page {
    background-color: #e8f4fc;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #3498db;
    font-weight: 500;
}

.page-size-selector {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-size-selector label {
    font-weight: 500;
    color: #2c3e50;
}

.page-size-selector select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.page-size-selector select:hover {
    border-color: #3498db;
}

.page-size-selector select:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.pagination-ellipsis {
    padding: 10px 5px;
    color: #95a5a6;
    font-size: 16px;
}

.go-to-page-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    justify-content: center;
}

.go-to-page-form label {
    font-weight: 500;
    color: #2c3e50;
}

.go-to-page-form input[type="number"] {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    width: 80px;
    text-align: center;
}

.go-to-page-form input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.no-results {
    text-align: center;
    padding: 50px 20px;
    background-color: #fff8e1;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 4px solid #ffc107;
}

.no-results h3 {
    color: #ff9800;
    margin-bottom: 15px;
    font-size: 22px;
}

.no-results p {
    color: #666;
    margin-bottom: 10px;
    font-size: 16px;
}

.no-results a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.no-results a:hover {
    text-decoration: underline;
}

/* Responsive para paginación */
@media (max-width: 768px) {
    .pagination a, 
    .pagination span {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 40px;
    }
    
    .results-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-size-selector {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .go-to-page-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .go-to-page-form label {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .pagination a, 
    .pagination span {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
    }
    
    .total-results,
    .current-page {
        font-size: 14px;
        padding: 6px 12px;
    }
}
/* Estilos para mensajes de error/seguridad */
.error-message {
    background-color: #fee;
    border: 2px solid #f99;
    color: #c00;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
}

.security-warning {
    background-color: #fff8e1;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
}

/* Deshabilitar botones mientras se procesa */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}