/* Custom CSS for Baratop */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--warning-color) !important;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-lg {
    padding: 0.75rem 2rem;
}

/* Cards */
.card {
    border-radius: 12px;
    border: none;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Form Controls */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1.5rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Product Card Styles */
.product-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.platform-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-badge {
    font-weight: 700;
    font-size: 0.8rem;
}

.price-section {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
    margin-top: auto;
}

/* Rating Stars */
.rating .stars i {
    font-size: 0.9rem;
    margin-right: 1px;
}

/* Favorite Button */
.favorite-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
    font-weight: 500;
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Filters */
.filters-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

/* Improved Filters Section */
.card-header {
    border-bottom: 2px solid #e9ecef;
}

.card-header .card-title {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.form-label.fw-semibold {
    color: var(--dark-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-label i {
    color: var(--primary-color);
    width: 14px;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: var(--secondary-color);
    font-weight: 500;
}

.btn.flex-fill {
    min-width: 0;
}

/* Filter form responsive improvements */
@media (max-width: 768px) {
    .form-label.fw-semibold {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn.flex-fill {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .btn.flex-fill {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .btn.flex-fill:last-child {
        margin-bottom: 0;
    }
}

/* Enhanced shadow for filter card */
.card.shadow-sm {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #e3e6f0;
}

.card.shadow-sm:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12) !important;
    transition: box-shadow 0.15s ease-in-out;
}

/* Category Cards */
.category-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid #e9ecef;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.category-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Platform Cards */
.platform-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    padding: 2rem;
}

.platform-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--warning-color) !important;
}

/* Legal Pages Styles */
.privacy-content, .terms-content {
    font-size: 1rem;
    line-height: 1.7;
}

.privacy-content h2, .terms-content h2 {
    color: var(--primary-color);
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.privacy-content h3, .terms-content h3 {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.privacy-content ul, .terms-content ul {
    padding-left: 1.5rem;
}

.privacy-content li, .terms-content li {
    margin-bottom: 0.5rem;
}

.privacy-content .alert, .terms-content .alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.privacy-content .alert-info, .terms-content .alert-info {
    background-color: #e7f3ff;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

.privacy-content strong, .terms-content strong {
    color: var(--dark-color);
}

.privacy-content a, .terms-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.privacy-content a:hover, .terms-content a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Legal pages responsive adjustments */
@media (max-width: 768px) {
    .privacy-content, .terms-content {
        font-size: 0.95rem;
    }
    
    .privacy-content .card-body, .terms-content .card-body {
        padding: 2rem 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .filters-section {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.5rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utilities */
.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Search Suggestions Styles */
.search-container {
    position: relative;
}

.search-suggestions {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    background: white;
}

.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.suggestion-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #f8f9fa !important;
    border-left: 4px solid var(--primary-color) !important;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

.suggestion-item img {
    border: 1px solid #e9ecef;
}

.hover-bg-light:hover {
    background-color: #f8f9fa !important;
}

/* Highlight texto da busca */
.search-suggestions mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
}

/* Loading animation */
.search-suggestions .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .search-suggestions {
        max-height: 300px;
        margin-top: 5px;
    }
    
    .suggestion-item {
        padding: 0.75rem !important;
    }
    
    .suggestion-item img {
        width: 40px !important;
        height: 40px !important;
    }
}
