/* Variables */
:root {
    --primary: #00256e;
    --primary-hover: #003399;
    --secondary: #00ff84;
    --danger: #ff3366;
    --dark: #121212;
    --light: #ffffff;
    --text-dark: #333333;
    --text-light: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Main Banner */
.main-banner {
    margin: 80px 30px 30px;
    width: calc(100% - 60px);
    height: 550px;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.banner-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.banner-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}

.banner-slide.active {
    opacity: 1;
    z-index: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-arrow.prev {
    left: 20px;
}

.carousel-arrow.next {
    right: 20px;
}

/* Categories Section */
.categories-section {
    padding: 40px 30px;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.categories-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 0 40px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.categories-grid::-webkit-scrollbar {
    display: none;
}

.category-card {
    flex: 0 0 120px;
    max-width: 120px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
}

.category-card:hover,
.category-card.active {
    transform: translateY(-5px);
}

.category-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.category-card h3 {
    padding: 8px;
    margin: 0;
    font-size: 12px;
    text-align: center;
    color: var(--text-dark);
}

.category-card.active h3 {
    color: var(--primary);
    font-weight: bold;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 20px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid var(--border);
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-container input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 37, 110, 0.1);
}

.search-container button {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 18px;
}

/* Products Grid */
.products-grid {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.products-container {
    display: flex;
    flex-direction: column;
}

.products-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 60px;
    margin: 0 -10px;
}

.products-row .product-card {
    flex: 0 0 280px;
    max-width: calc(25% - 22.5px);
    background: var(--light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 420px;
    min-height: 400px;
}

.products-row .product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.products-row .product-image {
    height: 200px;
    position: relative;
}

.products-row .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.products-row .product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.products-row .product-info h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.products-row .product-info h3:hover {
    animation-play-state: paused;
}

.products-row .provider-name {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.products-row .price-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.products-row .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.products-row .stock {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 15px;
}

.products-row .action-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.products-row .btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.products-row .btn-primary {
    background: var(--primary);
    color: white;
}

.products-row .btn-primary:hover {
    background: var(--primary-hover);
}

.products-row .btn-secondary {
    background: #e9ecef;
    color: var(--primary);
}

.products-row .btn-secondary:hover {
    background: #dee2e6;
}

.offer-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--secondary);
    color: var(--text-dark);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 15px;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    color: #333;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.toast.success {
    background: #4caf50;
    color: white;
}

.toast.error {
    background: #f44336;
    color: white;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Dark Mode */
.dark-mode {
    background: var(--dark);
    color: var(--text-light);
}

.dark-mode .product-card {
    background: #1a1a1a;
}

.dark-mode .product-info h3 {
    color: var(--secondary);
}

.dark-mode .price {
    color: var(--secondary);
}

.dark-mode .search-container input {
    background: #1a1a1a;
    border-color: #333;
    color: white;
}

.dark-mode .search-container button {
    color: var(--secondary);
}

.dark-mode .categories-section {
    background: #1a1a1a;
}

.dark-mode .categories-section h2 {
    color: var(--secondary);
}

.dark-mode .category-card {
    background: #242424;
}

.dark-mode .category-card h3 {
    color: var(--text-light);
}

.dark-mode .modal-content {
    background: #1a1a1a;
    color: var(--text-light);
}

/* HEADER STYLES */
.main-header {
   background: #fff;
   box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   z-index: 1000;
   height: 80px;
}

.header-container {
   max-width: 1200px;
   margin: 0 auto;
   padding: 0 20px;
   display: flex;
   justify-content: space-between;
   align-items: center;
   height: 100%;
}

.logo {
   height: 100%;
   display: flex;
   align-items: center;
}

.logo img {
   height: 75px;
   width: auto;
}

.header-right {
   display: flex;
   align-items: center;
   gap: 20px;
   height: 100%;
}

.wallet-balance {
   background: #f8f9fa;
   padding: 8px 15px;
   border-radius: 20px;
   display: flex;
   align-items: center;
   gap: 8px;
}

.wallet-balance i {
   color: #00256e;
}

.wallet-balance span {
   font-weight: 500;
   color: #00256e;
}

.header-link {
   display: flex;
   align-items: center;
   gap: 5px;
   color: #00256e;
   text-decoration: none;
   padding: 8px 15px;
   border-radius: 20px;
   transition: background-color 0.3s;
}

.header-link:hover {
   background: #f8f9fa;
}

.dark-mode-toggle {
   background: none;
   border: none;
   padding: 8px;
   cursor: pointer;
   color: #00256e;
}

.user-menu {
   position: relative;
}

.menu-toggle {
   background: none;
   border: none;
   padding: 8px;
   cursor: pointer;
   color: #00256e;
}

.dropdown-menu {
   display: none;
   position: absolute;
   top: 100%;
   right: 0;
   background: white;
   box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
   border-radius: 8px;
   padding: 10px 0;
   min-width: 200px;
}

.dropdown-menu.show {
   display: block;
}

.user-info {
   padding: 10px 15px;
   border-bottom: 1px solid #eee;
   display: flex;
   align-items: center;
   gap: 10px;
}

.logout-btn {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 10px 15px;
   color: #dc3545;
   text-decoration: none;
   transition: background-color 0.3s;
}

.logout-btn:hover {
   background: #f8f9fa;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .products-row {
        flex-wrap: wrap;
    }

    .products-row .product-card {
        flex: 0 0 calc(33.33% - 20px);
        max-width: calc(33.33% - 20px);
    }
}

@media (max-width: 992px) {
    .products-row .product-card {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }

    .main-banner {
        height: 400px;
    }

    .banner-slide {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .main-header {
        height: 60px;
    }

    .header-container {
        padding: 0 15px;
    }

    .logo img {
        height: 50px;
    }

    .wallet-balance {
        padding: 6px 10px;
    }

    .header-link span {
        display: none;
    }

    .header-right {
        gap: 10px;
    }

    .products-row .product-card {
        flex: 0 0 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }

    .main-banner {
        height: 300px;
        margin: 60px 15px 15px;
        width: calc(100% - 30px);
    }

    .banner-slide {
        height: 300px;
    }

    .carousel-arrow {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .products-row .product-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .main-banner {
        height: 200px;
    }

    .banner-slide {
        height: 200px;
    }

    .carousel-arrow {
        width: 25px;
        height: 25px;
    }

    .carousel-arrow.prev {
        left: 10px;
    }

    .carousel-arrow.next {
        right: 10px;
    }
}

@media (min-width: 1400px) {
    .products-container {
        padding: 0 30px;
    }
}

/* Auth Styles */




.auth-box .logo {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.auth-box .logo img {
    max-width: 180px;
    height: auto;
}

.auth-box h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 37, 110, 0.1);
}

.auth-button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.auth-button:hover {
    background: var(--primary-hover);
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}