/* Professional Fonts */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
}

/* Color Scheme */
:root {
    --primary-color: #004080; /* Blue */
    --secondary-color: #218838; /* Green */
    --background-color: #f9f9f9;
    --text-color: #333;
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 10px;
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.top-nav .logo-container img,
.top-nav img {
    height: 50px;
    display: block;
    padding-inline-end: 7px;
}

.top-nav a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
}

/* Mobile View */
@media (max-width: 768px) {
    .top-nav {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .search-bar {
        margin-right: 10px;
        max-width: 150px;
    }

    body, html {
        height: 100%; /* Ensure full height for the layout */
        margin: 0;
    }

    .content {
        min-height: 100%; /* Ensures the content takes at least the full screen height */
        padding-bottom: 60px; /* Adds space at the bottom for footer */
    }

    footer {
        width: 100%;
        background-color: #333; /* Footer background */
        color: white;
        text-align: center;
        padding: 15px;
        position: inherit !important;
        bottom: 0; /* Make sure it's at the bottom of the content */
    }

    .product-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* Forces exactly 2 columns */
        gap: 10px !important;
        padding: 10px !important;
        align-items: stretch !important; /* Ensures each row item stretches to match the tallest product */
    }

    .product {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: auto !important; /* Let content define the height */
    }
}


/* Product List */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    row-gap: 40px;
    padding: 10px 10px 30px;
    margin-bottom: 80px;
}

.product {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    background: #fff;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Ensures all products have the same height */
    padding-bottom: 10px; 
}


.product img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.product:hover {
    transform: translateY(-10px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product .product-info {
    flex-grow: 1; /* Allows the text section to expand naturally */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Ensures price stays above the button */
}

.product:hover img {
    transform: scale(1.1);
}

.product .description {
    flex-grow: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
}

.product .price {
    font-weight: bold;
    font-size: 16px;
    margin-top: 5px;
}


.product .buy-btn {
    width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modal img {
    width: 100%;
    height: auto; /* Maintains aspect ratio */
    max-height: 80vh; /* Prevents image from being too tall */
    object-fit: contain; /* Ensures the entire image is visible without cropping */
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* Buy Button */
.buy-btn {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin-top: 5px; /* Pushes the button to the bottom */
}

.buy-btn:hover {
    background-color: #1e7e34;
    transform: scale(1.05);
}

/* Notification Styling */
.notification {
    position: fixed;
    top: 93px;
    right: 25px;
    background-color: green;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    display: none;
    font-size: 14px;
    z-index: 1000;
    transition: opacity 0.5s ease-in-out;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: center;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* Search Bar */
.search-bar {
    flex-grow: 1;
    position: relative;
    max-width: 250px;
    margin-right: 20px;
}

.search-bar input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.search-bar .clear-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #ccc;
    font-size: 16px;
}

/* Menu */
.menu-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
}

.menu a:hover {
    color: #00cc99;
}

.menu .buy-btn {
    background: green;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.menu .buy-btn:hover {
    background: darkgreen;
}

/* Right Side Menu */
.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.right-panel {
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100%;
    background-color: var(--primary-color);
    color: white;
    transition: right 0.3s ease;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    visibility: hidden;
}

.right-panel.open {
    margin-top: 80px;
    right: 0;
    visibility: visible;
}

.panel-content a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 0;
    font-size: 16px;
}

.panel-content a:hover {
    background-color: #005c99;
}

.cart-icon-wrapper {
    display: flex; /* Use flexbox to align items horizontally */
    align-items: center; /* Vertically center the cart count */
}

.cart-icon-wrapper .cart-icon {
    margin-right: 10px; /* Add some space between the icon and the count */
}

.footer a {
    color:#ccc;
}

@font-face {
    font-family: 'Roboto';
    src: url('KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBA.woff2') format('woff2'),
         url('KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBA.woff2') format('woff');
    font-display: swap; /* La fuente será reemplazada por la predeterminada hasta que se cargue la fuente principal */
}

/* Add to your existing styles */
.navbar .cart-count {
    font-size: 1.2rem; /* Increase the size */
    font-weight: bold;
    color: #fff; /* Ensure the color contrasts well */
    padding: 5px 10px;
    background-color: #004080; /* Same as button color */
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px; /* Adjust height */
    min-width: 30px; /* Ensure it doesn’t shrink */
    text-align: center;
}

@media (max-width: 768px) {
    .navbar .cart-count {
        font-size: 1.1rem; /* Adjust for mobile view */
        margin-left: 10px; /* Space between cart icon and number */
    }
}




/* Updated Navbar styles for cart count alignment */
.cart-icon-wrapper {
    display: flex; /* Use flexbox to align items horizontally */
    align-items: center; /* Vertically center the cart count */
    justify-content: center; /* Make sure content is centered horizontally */
    gap: 5px; /* Space between cart icon and count */
}



/* Ensure the search box and cart icon have the same height */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-bar input {
    height: 40px; /* Adjust to your desired height */
    font-size: 16px;
    padding: 0 10px;
}

.cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px; /* Match this height with the search input height */
    padding: 0 10px;
    font-size: 18px;
    background-color: var(--background-color);
    border: 1px solid #000; /* Adjust if needed */
    border-radius: 5px;
    cursor: pointer;
}

.cart-btn span {
    font-size: 14px; /* Adjust the size of the count number */
    margin-left: 5px;
}

@media (max-width: 768px) {
    .top-nav {
        flex-wrap: wrap; /* Allow wrapping if necessary */
        justify-content: space-between;
        align-items: center; /* Ensure items are centered vertically */
    }

    .search-bar {
        margin-right: 10px;
        max-width: 150px;
    }

    body, html {
        height: 100%;
        margin: 0;
    }

    .content {
        min-height: 100%;
        padding-bottom: 60px;
    }

    footer {
        width: 100%;
        background-color: #333;
        color: white;
        text-align: center;
        padding: 15px;
        position: inherit !important;
        bottom: 0;
    }

    .product-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px !important;
        align-items: stretch !important;
    }

    .product {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: auto !important;
    }

    /* Fix for cart icon and search bar alignment */
    .cart-btn,
    .search-bar {
        height: 40px;
        font-size: 16px;
    }

    .cart-icon-wrapper {
        gap: 10px;
    }

    /* Prevent stacking */
    .menu-container {
        display: flex;
        align-items: center;
        gap: 15px;
    }
}

body, html {
    height: 100%;
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.top-nav,
.product-list,
footer {
    width: 100%;
    box-sizing: border-box; /* Prevent padding/margin from causing overflow */
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    row-gap: 40px;
    padding: 10px 10px 30px;
    margin-bottom: 80px;
    box-sizing: border-box; /* Ensures padding doesn't add to width */
}

.product {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    background: #fff;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-bottom: 10px; 
}

footer {
    position: inherit !important;
    bottom: 0;
    box-sizing: border-box; /* Prevent footer from pushing out of view */
}



@media (max-width: 768px) {
    .top-nav {
        flex-wrap: wrap; /* Allow items to wrap instead of stacking */
        justify-content: space-between;
        align-items: center; /* Ensures items stay aligned in the center */
    }

    .search-bar {
        margin-right: 10px;
        max-width: 150px;
        margin-right: 2px;
    }

    .menu-container {
        display: flex;
        align-items: center;
    }

    .cart-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .top-nav .logo-container,
    .top-nav .search-bar,
    .top-nav .menu-container {
        flex: 1;
    }
}

/* Navigation Container */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Ensure it takes the full width */
    padding: 10px 10px;
}

/* Adjust the search bar to take the available space without overlapping */
.search-bar {
    flex-grow: 1; /* Allows the search bar to take all available space */
    max-width: 200px; /* Limit the maximum width of the search bar */
    margin-left: 10px; /* Adds space between the search bar and logo */
    margin-right: 20px; /* Adds space to the right side for the cart */
    position: relative;
}

/* Adjust the cart icon and count */
.cart-icon-wrapper {
    display: flex; /* Align items horizontally */
    align-items: center; /* Vertically center the cart count */
    gap: 10px; /* Space between cart icon and count */
}

.cart-icon-wrapper .cart-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background-color: var(--primary-color); /* Set background to primary color */
    padding: 5px 10px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-width: 30px;
    text-align: center;
}


/* Logo Container */
.top-nav .logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 52px; /* Limit the max width to the size of the logo */
}

/* Logo Image */
.top-nav .logo-container img {
    height: 70px; /* Set the height of the logo */
    width: auto; /* Allow width to scale based on height */
}

/* Logo Container */
.top-nav .logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 120px; /* Limit the max width to the size of the logo */
}
