body {
    background-color: var(--background-color);
    color: var(--text-color);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling on the body */
}

.wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
}

.row-container {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    flex-direction: row; /* Default: Sidebar next to Main */
}

.sidebar {
    flex: 0 0 auto;
    width: 250px; /* Set width for desktop */
    overflow-y: auto;
}

/* When the screen is smaller (mobile view), move sidebar to top */
@media (max-width: 768px) {
    .row-container {
        flex-direction: column; /* Stack vertically */
    }

    .sidebar {
        width: 100%; /* Full width at the top */
        flex: 0 0 auto; /* Prevents unnecessary shrinking */
    }
}


.main {
    flex-grow: 1; /* Expands to take remaining space */
    overflow-y: auto; /* Scroll only when content overflows */
}

.custom-footer {
    background-color: royalblue;
    color: white;
    text-align: center;
    padding: 10px 0;
    width: 100%;
    position: relative; /* Change from absolute */
    flex-shrink: 0; /* Prevent shrinking */
}

.card-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header {
    flex: 0 0 auto; /* Keeps the header at its natural height */
}

.custom-header {
    background-color: royalblue;
    color: white;
}

.custom-header-error {
    background-color: red;
    color: white;
}

.custom-header-success {
    background-color: green;
    color: white;
}

.custom-header .nav-link {
    color: white;
}

.custom-header .nav-link:hover {
    color: lightgray;
}

.fill-container {
    height: calc(100vh - 116px);
    width: 100vw;
    --bs-gutter-x: 0 !important;
}

.cart-sidebar {
    position: fixed;
    z-index: 2;
    top: 0;
    right: -300px; /* Initially hidden */
    width: 300px;
    height: 100%;
    background-color: #f8f9fa;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    padding: 20px;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    margin-bottom: 10px;
}

.btn-close {
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
}

.cart-body {
    flex-grow: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.cart-item-name {
    flex: 1;
    font-size: 16px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty {
    width: 40px;
    text-align: center;
    border: 1px solid #ccc;
}

.remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 20px;
    cursor: pointer;
}

.cart-btn {
    background-color: #007bff;
    color: white;
    font-size: 24px;
    padding: 5px 12px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cart-btn:hover {
    background-color: #0056b3;
}

.cart-btn i {
    font-size: 24px;
}

#cartCount {
    font-weight: bold;
    font-size: 14px;
}

.cart-footer {
    padding-top: 10px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.cart-footer h5 {
    margin-bottom: 10px;
}

#checkoutButton {
    width: 100%;
    padding: 10px;
    font-size: 18px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
}

.icon-btn i {
    font-size: 28px; 
    color: #6c757d; 
    transition: color 0.2s ease-in-out;
}

.icon-btn:hover i {
    color: #343a40; 
}

.search-box {
    display: none; /* Initially hidden */
    margin-left: 10px;
}

#searchInput {
    width: 200px;
    transition: width 0.3s ease-in-out;
    padding-right: 30px; /* Makes space for the clear icon */
}

.mdi-close-circle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: none; /* Hidden until text is typed */
}