/* Reset and Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

body {
  font-family: Arial, sans-serif;
}

/* Call-to-action button */
.call-to-action-container input[type=submit] {
  width: 50%;
  background-color: #FFA500;
  color: white;
  padding: 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 10px;
}

.call-to-action-container input[type=submit]:hover {
  background-color: #FF8C00;
}

.centered {
  text-align: center;
}

h2 {
  background-color: #4CAF50;
  color: white;
  text-align: center;
  padding: 5px;
  width: 100%;
  margin: 0;
  margin-bottom: 5px;
}

/* START nav-bar */

/* Navbar styling */
.navbar-dark {
  background-color: #4CAF50;
}

.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-brand {
  display: flex;
  justify-content: flex-end;
  color: #FFFFFF;
  transition: color 0.2s ease-in-out;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-brand:hover {
  color: #F3ECEC;
}

.navbar-dark .navbar-toggler {
  color: #FFFFFF;
  border-color: #FFFFFF;
  background-color: transparent;
}

/* END nav-bar */

/* Jumbotron styles */
.jumbotron {
  background-size: cover;
  height: 100px;
  background-position: center bottom 35%;
  margin: 0;
}

/* START Carrousel */

/* Ensures the carousel stays centered */
.carousel {
  width: 100%;
  max-width: 600px;
  margin: 10px auto; /* Center the carousel */
  display: flex;
  justify-content: center;
}

/* Default Bootstrap behavior: keeps slides positioned properly */
.carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-item img {
  width: 100%;
  height: 250px;
  object-fit: contain;
}

/* Styling for captions below the image */
.carousel-caption-below {
  margin-top: 10px; /* Adds spacing between image and text */
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: #4CAF50;
}

.carousel-control-prev-icon::before,
.carousel-control-next-icon::before {
  color: white;
}

/* END Carrousel */

/* START Contact Form */

/* Contact form styles */
.contact-form {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.contact-form .form-header {
  margin-bottom: 20px;
}

.contact-form .form-header p {
  font-size: 14px;
  color: #555;
}

.contact-form .form-group,
.login-container .form-group {
  margin-bottom: 20px;
}

.contact-form label,
.login-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.contact-form input[type=text],
.contact-form input[type=email],
.contact-form input[type=password],
.contact-form textarea {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.contact-form textarea {
  min-height: 150px;
}

.success-message {
  display: none;
  color: green;
  font-weight: bold;
}

/* END Contact Form */

/* Login container */
.login-container {
  text-align: center;
  max-width: 400px;
  margin: auto;
}

.login-container h2 {
  background-color: #4CAF50;
  color: white;
  padding: 8px;
  border-radius: 4px;
}

/* Admin Pages styling */
.readonly {
  background-color: #f0f0f0;
  color: #000;
  pointer-events: none;
}

/* Universal styling for form elements */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 20px;
  margin-left: 10px;
  margin-right: 10px;
  position: relative;
}

/* Image upload and edit */
.image-upload-group {
  margin-top: 15px;
  margin-bottom: 30px;
}

.image-upload-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.existing-image-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.thumbnail-img {
  width: 100px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  margin-right: 10px;
}

.image-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.delete-label {
  cursor: pointer;
  font-weight: normal;
}

/* START Button Styling */

/* Button Group Styling */
.button-group {
  position: relative;
  bottom: 10px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 15px;
}

/* Center the Login button */
.center-button {
  display: flex;
  justify-content: center; /* Center horizontally */
  margin: 20px;
}

.button-group.right-align {
  justify-content: flex-end; /* Moves the button to the right */
}

/* For cancel and continue/save buttons */
.button-pair {
  display: flex;
  justify-content: space-between;
  gap: 15px; /* Space between buttons */
  margin: 20px auto; /* Adds margin to bottom & prevents touching screen edges */
  padding: 0 20px; /* Adds space from left/right edges */
  width: 100%;
  max-width: 800px; /* Prevents excessive stretching on large screens */
}

/* Container for list-style buttons (ensures proper spacing) */
.button-list-container {
  padding: 10px 20px; /* Padding around the button list */
  display: flex;
  justify-content: center;
}

/* Responsive Button List */
.button-list {
  display: flex;
  flex-wrap: wrap; /* Allows wrapping for multi-column layout */
  gap: 10px; /* Space between buttons */
  justify-content: center; /* Center-align in rows */
  width: 100%;
  max-width: 1000px; /* Prevents overly wide buttons */
}

/* Style for individual buttons */
.action-button {
  background-color: #007bff !important;
  color: white !important;
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
  padding: 10px 20px;
  border: none;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: normal !important;
  text-decoration: none;
  width: 100%; /* Full width on small screens */
  max-width: 300px; /* Prevents stretching */
  flex: 1 1 calc(100% - 20px); /* Default: Single column */
}

/* Ensuring Equal Width for Buttons ONLY in .button-pair */
.button-pair .pair-button {
  flex: 0 1 150px; /* Prevents excessive stretching */
  min-width: 120px; /* Prevents it from being too small */
  max-width: 180px; /* Keeps both buttons similar in width */
}

/* Hover Effects */
.action-button:hover {
  background-color: #0056b3;
  color: white;
  text-decoration: none;
}

/* Cancel button styling */
.cancel-button {
  background-color: #dc3545;
  color: white !important;
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
  padding: 10px 20px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: normal !important; /* Ensure consistency */
}

.cancel-button:hover {
  background-color: #c82333;
  color: white;
  text-decoration: none;
}


/* Unified Save & Block Button Styling */
.save-button {
  background-color: #007bff !important;
  color: white !important;
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
  padding: 10px 20px;
  border: none;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: normal !important;
  text-decoration: none;
  width: 100%; /* Default full width on mobile */
  max-width: 300px; /* Prevent excessive width */
  flex: 1 1 calc(100% - 20px); /* Single column by default */
}

.save-button:hover{
  background-color: #0056b3 !important;
  color: white;
}

/* END Button Styling */

/* START Welcome User Container */

.welcome-container {
  display: flex;
  justify-content: space-between; /* Pushes elements to opposite sides */
  align-items: center; /* Aligns items vertically */
  width: 100%; /* Ensures it spans the full width */
  padding: 10px 20px;
  font-size: 16px;
}

.welcome-message {
  margin: 0; /* Removes default margin */
  font-weight: bold;
}

.welcome-role {
  margin: 0;
  font-style: italic;
}

/* END Welcome User Container */

/* General Styling */
h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

button {
  cursor: pointer;
  border: none;
  transition: background-color 0.3s ease; /* Smooth hover transition */
}

/* General Divider */
.divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 10px 0; /* Space around divider */
}

/* Header Row */
.header-row {
  display: flex;
  align-items: center; /* Vertically align items */
  justify-content: space-between; /* Space between h3 and button */
  margin-bottom: 10px; /* Space below header row */
}

/* Filter Button */
.open-popup {
  background-color: #007bff; /* Blue background */
  color: white; /* White icon color */
  border-radius: 50%; /* Circular button */
  width: 40px;
  height: 40px;
  display: flex; /* Keep flex for layout consistency */
  justify-content: center; /* Horizontal centering */
  align-items: center; /* Vertical centering */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 0; /* Fix font-based misalignment */
}

.filter-icon {
  font-size: 20px; /* Size of the icon */
  vertical-align: middle; /* Ensure proper alignment inside flexbox */
  line-height: 1; /* Reset line height for font icons */
  position: relative; /* Allows for manual adjustment */
  top: -1px; /* Slight nudge upward to center the icon */
}

.open-popup:hover {
  background-color: #0056b3; /* Darker blue on hover */
}

.filter-icon {
  font-size: 20px;
  line-height: 1;
  margin: 0; /* Ensure icon is centered */
}

/* Popup Styling */
.popup {
  position: fixed;
  bottom: -100%; /* Hidden by default */
  left: 0;
  width: 100%;
  background: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  transition: bottom 0.3s ease-in-out;
  padding: 20px;
}

.popup.visible {
  bottom: 0; /* Slide up into view */
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: relative;
}

button.close-popup {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

button.close-popup:hover {
  color: #f00;
}

/* Filter Section */
.filter-trigger-container {
  display: flex;
  justify-content: flex-end;
  padding: 5px;
}

.filter-item {
  margin-bottom: 10px; /* Adds spacing between filter fields */
}

.apply-filters-btn {
  background-color: #007bff; /* Blue background */
  color: white; /* White text */
  padding: 10px 15px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 5px; /* Rounded corners */
  float: right; /* Move to the right-hand side */
}

.apply-filters-btn:hover {
  background-color: #0056b3; /* Darker blue on hover */
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Responsive grid layout */
  gap: 20px; /* Space between products */
  padding-bottom: 40px; /* Add padding to the bottom */
}

.product-item {
  border: 1px solid #ddd; /* Light grey border */
  border-radius: 5px; /* Rounded corners */
  padding: 15px;
  padding-bottom: 60px; /* Ensure space for the cart button */
  cursor: pointer; /* Indicate clickability */
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  text-align: left; /* Ensure all text is left-aligned */
  background: #fff; /* White background */
  position: relative; /* To position the cart button at the bottom-right */
}

.product-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Slight shadow on hover */
  transform: scale(1.02); /* Slightly enlarge on hover */
}

.product-item img {
  max-width: 100%; /* Ensure the image fits within the container */
  height: auto; /* Maintain aspect ratio */
  border-radius: 5px; /* Match border radius of the container */
}

.product-item h3, 
.product-item p {
  margin: 5px 0; /* Space between text elements */
}

/* Add to Cart Button */
.add-to-cart-btn {
  background-color: #ff6600; /* Orange background */
  color: white; /* White icon color */
  padding: 10px 15px;
  font-size: 16px;
  border-radius: 5px; /* Rounded corners */
  display: inline-flex; /* Align icon properly */
  justify-content: center;
  align-items: center;
  position: absolute; /* Position button */
  bottom: 15px; /* Offset from bottom */
  right: 15px; /* Offset from right */
}

.add-to-cart-btn:hover {
  background-color: #cc5200; /* Darker orange for hover effect */
}

.add-to-cart-btn i {
  margin-right: 5px; /* Optional: Add spacing if text is added next to the icon */
}

/* Footer styles */
footer {
  background-color: #4CAF50;
  color: white;
  height: auto;
  width: 100%;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}

footer .social_network {
  display: flex;
  justify-content: flex-end;
}

footer .social_network a {
  color: white;
}

footer .social_network a:hover {
  color: blue;
}

footer .social_network a i {
  font-size: 12px;
  margin-left: 10px;
  padding-right: 10px;
}

footer p {
  margin: 0;
}

/* Media queries for screen sizes */
/* Medium screen */
@media only screen and (min-width: 577px) and (max-width: 1024px) {
  .jumbotron {
    height: 200px;
    letter-spacing: 2px;
  }

  .jumbotron h1 {
    font-size: 50px;
    padding: 10px;
  }

  .jumbotron p {
    font-size: 18px;
    padding: 10px;
  }

  .jumbotron h2 {
    font-size: 24px;
    padding: 10px;
  }

  .carousel {
    max-width: 700px; /* Allow it to be slightly larger */
  }

  .action-button {
    flex: 1 1 calc(50% - 20px); /* Two columns */
  }
  
}

/* Large screen */
@media only screen and (min-width: 1025px) {
  .jumbotron {
    height: 500px;
    letter-spacing: 2px;
  }

  h1 {
    font-size: 50px;
    padding: 10px;
  }

  p {
    font-size: 18px;
    padding: 20px;
  }

  .carousel {
    max-width: 800px; /* Expand carousel width for larger screens */
  }

  .action-button {
    flex: 1 1 calc(33.333% - 20px); /* Three columns */
}

}