/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f4f9;
    color: #333;
    padding-top: 130px; /* Adjust based on the combined height of the header and search section */
    padding-bottom: 60px; /* Ensure there's space for the bottom buttons */
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header styling */
.main-header {
    background-color: #2c3e50;
    padding:  0;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed; /* Fix the header at the top */
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensure it stays above other content */
    height: 80px;
    
}

.main-header .logo img {
    height: 110px;
    width: auto;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-button {
    font-size: 28px;
    cursor: pointer;
    color: #ecf0f1;
    transition: color 0.3s;
}

.cart-button:hover {
    color: #e74c3c;
}

/* Search section styling */
.search-section {
    position: fixed; /* Fix the search section at the top */
    top: 80px; /* Adjust this value based on the header's height */
    left: 0;
    width: 100%;
    background-color: #fff;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Ensure it stays above other content */
}

.search-section .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

#search-bar {
    width: 100%;
    max-width: 600px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

#search-button {
    background-color: #e74c3c;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
}

#search-button i {
    font-size: 16px;
}

/* Product list styling */
.product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* Adjust margin-top to accommodate the fixed elements */
.product-list {
    margin-top: 30px; /* Add top margin to ensure visibility */
    padding-bottom: 60px; /* Add padding to ensure space for the bottom buttons */
}

.product-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 250px;  
}
.add-to-cart-container {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    margin-top: -10px;
  }
  

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.product-image img {
    width: 100%;
    height: 150px; /* Adjust image height */
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
}

.product-details {
    padding: 10px;
    text-align: center;
}

.product-details h2 {
    font-size: 14px; /* Adjust title size */
    margin-bottom: 10px;
    color: #2c3e50;
}

.product-color,
.product-price,
.product-description {
    margin-bottom: 10px;
    color: #777;
}

.product-price {
    font-size: 12px; /* Adjust price size */
    font-weight: 500;
    color: #e74c3c;
}

.add-to-cart {
    background-color: #e74c3c;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-to-cart:hover {
    background-color: #c0392b;
}

/* Bottom buttons styling */
.bottom-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #2c3e50;
    padding: 15px 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.bottom-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ecf0f1;
    font-size: 14px;
    transition: color 0.3s;
}

.bottom-button i {
    font-size: 24px;
}

.bottom-button span {
    margin-top: 5px;
}

.bottom-button:hover {
    color: #e74c3c;
}


/* Loading Overlay */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8); /* semi-transparent white overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* high z-index so it appears on top */
  }
  
  /* Spinner Container */
  .spinner {
    --uib-size: 40px;
    --uib-color: #e74c3c; /* Spinner dot color */
    --uib-speed: 1.3s;
    --uib-dot-size: 25%;
    position: relative;
    display: inline-block;
    height: var(--uib-size);
    width: var(--uib-size);
    animation: spin var(--uib-speed) infinite linear;
  }
  
  /* Dot styles */
  .spinner .dot {
    position: absolute;
    left: calc(50% - var(--uib-dot-size) / 2);
    width: var(--uib-dot-size);
    height: 100%;
  }
  
  .spinner .dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding-bottom: 100%;
    background-color: var(--uib-color);
    border-radius: 50%;
    transition: background-color 0.3s ease;
  }
  
  /* Staggered animations for the dots */
  .spinner .dot:nth-child(1) {
    transform: rotate(120deg);
  }
  .spinner .dot:nth-child(1)::after {
    animation: wobble var(--uib-speed) infinite ease-in-out;
  }
  
  .spinner .dot:nth-child(2) {
    transform: rotate(-120deg);
  }
  .spinner .dot:nth-child(2)::after {
    animation: wobble var(--uib-speed) infinite ease-in-out;
  }
  
  .spinner .dot:nth-child(3)::after {
    animation: wobble var(--uib-speed) infinite ease-in-out;
  }
  
  /* Keyframes for spinner and wobble */
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  @keyframes wobble {
    0%, 100% { transform: translateY(0%); }
    50% { transform: translateY(65%); }
  }
  /* Style for the home/back button container */
.back-home {
    margin: 10px;
    text-align: left; /* or center, depending on your design */
  }
  
  /* Style for the home/back button */
  .back-button {
    display: inline-block;
    background-color: #007bff;  /* Blue background */
    color: #fff;                /* White text */
    padding: 8px 16px;          /* Spacing around the text */
    border-radius: 4px;         /* Rounded corners */
    text-decoration: none;      /* Remove underline */
    font-size: 16px;
    transition: background-color 0.3s ease;
  }
  
  /* Hover effect */
  .back-button:hover {
    background-color: #0056b3;  /* Darker blue when hovering */
  }
  .modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}
.modal-content {
    background-color: #fff;
    border-radius: 8px;
    margin: 10% auto;
    padding: 20px;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
}
.close {
    color: #333;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: #007bff;
}
  .cart-item-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -10px;
  }
  
  .quantity-btn {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    margin: 0 5px;
    font-size: 16px;
  }
  
  .quantity-btn:hover {
    background-color: #c0392b;
  }
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin: 20px 0;
  
}
.category-button {
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background-color: #e74c3c;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s;
}
.category-button:hover {
  background-color: #c0392b;
}
.cart-button {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e60023;
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 50%;
  display: none; /* hide when zero */
}
/* 1. Ensure smooth transitions */
.search-section,
.bottom-buttons {
  transition: transform 0.3s ease;
}

/* 2. When hidden, slide top bar up and bottom bar down */
.search-section.hidden {
  transform: translateY(-100%);
}

.bottom-buttons.hidden {
  transform: translateY(100%);
}