@import url(general.css);

/* Reset and box-sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body styles */
body {
  background-color: var(--background-color, #fff);
  font-weight: 400;
  font-style: normal;
  line-height: 1.65;
  padding: 10px;
  overflow-x: hidden;
}

/* Headings */
h1,
h2:not(.cart-store-title) {
  opacity: 0;
  visibility: hidden;
  /* transform: translateY(20px); */
  will-change: opacity, transform, visibility;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

h1.animate,
h2.animate {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Store container */
.stores {
  text-align: center;
  /* Align inline-block stores */
}

/* Store card */
.store {
  position: relative;
  display: inline-block;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  width: 30%;
  /* Three per row on large screens */
  aspect-ratio: 5/6;
  margin: 10px;
  color: var(--main-background-color, #fff);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  opacity: 0;
  visibility: hidden;
  /* transform: translateY(30px); */
  will-change: opacity, transform, visibility;
  transition: opacity 0.6s ease-out, transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.store.animate {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.store:hover {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

/* Store details overlay */
.store_details {
  position: absolute;
  top: calc(100% - 200px);
  height: 200px;
  width: 100%;
  background-image: linear-gradient(0deg, #777, transparent);
  background-repeat: repeat-x;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 0 0 10px 10px;
}

/* Store name and location */
.store_name {
  margin: 10px 20px 0;
  font-size: 1.5rem;
}

.store_location {
  margin: 10px 20px;
  font-size: 1rem;
}

/* View More button */
.view-more {
  display: inline-block;
  color: var(--main-background-color, #f7f7f7);
  background-color: var(--third-color, #333);
  padding: 12px 20px;
  border: none;
  outline: none;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 1rem;
  min-width: 120px;
  max-width: 200px;
  margin: 20px auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  will-change: opacity, transform, visibility;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out, background-color 0.4s ease-out;
}

.view-more.animate {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.view-more:hover {
  background-color: #000;
  transform: scale(1.05);
}

/* Separator */
.separator {
  border-bottom: 1px solid var(--secondary-text-color);
  margin: 20px 0;
}

/* Fade-up animation */
@keyframes fadeUp {
  to {
    opacity: 1;
    visibility: visible;
    /* transform: translateY(0); */
  }
}

/* Carousel styles */
.carousel-container {
  width: 100%;
  margin: 20px auto;
  overflow: hidden;
  position: relative;
}

.carousel {
  display: flex;
  animation: none;
  width: 100%;
  height: fit-content;
}

.carousel .store {
  width: 20%;
  aspect-ratio: 5/3;
  flex-shrink: 0;
  margin: 10px;
}

.carousel .store_details {
  height: 100%;
  top: 0;
}

.carousel .store_name {
  font-size: x-large;
  margin-top: 10px;
}

/* Carousel animation: Right to Left */
.right-to-left .carousel {
  animation: slideRightToLeft 20s linear infinite;
}

@keyframes slideRightToLeft {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-90%);
  }
}

/* Carousel animation: Left to Right */
.left-to-right .carousel {
  animation: slideLeftToRight 20s linear infinite;
}

@keyframes slideLeftToRight {
  0% {
    transform: translateX(-90%);
  }

  100% {
    transform: translateX(0);
  }
}

/* Pause animation on hover */
.carousel-container:hover .carousel {
  animation-play-state: paused;
}

/* Tabs */
.tab {
  display: inline-block;
  padding: 10px 20px;
  cursor: pointer;
  background: var(--main-background-color, #fff);
  border-bottom: none;
  margin-right: 5px;
  border-radius: 10px 10px 0 0;
}

.tab.active {
  background: var(--main-text-color, #000);
  color: var(--main-background-color, #fff);
  font-weight: bold;
}

.tab-content {
  display: none;
  border-radius: 0 0 5px 5px;
}

.tab-content.active {
  display: block;
}

/* Search section */
.search {
  width: 70%;
  margin: 40px auto;
}

/* Search form */
form {
  display: flex;
  align-items: center;
  background-color: var(--main-background-color, #fff);
  border-radius: 0 10px 10px 0;
  padding: 10px 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Inputs and selects */
input[type="text"],
select {
  padding: 10px;
  border: none;
  outline: none;
  height: 50px;
  border-radius: 10px;
  flex-grow: 1;
  transition: background-color 0.2s ease;
}

input[type="text"]:hover,
select:hover {
  background-color: var(--hover-color, #f0f0f0);
}

/* Search button */
.search_button {
  padding: 15px 0;
  background: var(--main-text-color, #000);
  color: var(--main-background-color, #fff);
  border: none;
  cursor: pointer;
  border-radius: 10px;
  flex-grow: 1;
  transition: background-color 0.2s ease;
}

.search_button:hover {
  background: #333;
}

/* Search separator */
.search_separator {
  width: 1px;
  height: 35px;
  background-color: var(--separator-color, #ccc);
  margin: 0 10px;
}

/* Responsive adjustments */
@media (max-width: 720px) {
  .stores {
    padding: 15px 5%;
  }

  .store {
    width: 45%;
    /* Two per row */
    margin: 7.5px;
  }

  .store_details {
    height: 150px;
    top: calc(100% - 150px);
  }

  .store_name {
    margin-top: 5px;
  }

  .store_location {
    margin: 5px 20px;
  }

  .view-more {
    min-width: 100px;
    max-width: 150px;
    padding: 10px 15px;
  }

  .search {
    width: 85%;
    margin: 30px auto;
  }

  .carousel .store {
    width: 30%;
  }
}

@media (max-width: 480px) {
  .stores {
    padding: 10px 5%;
  }

  .store {
    width: 100%;
    /* One per row */
    margin: 5px 0;
  }

  .store_details {
    height: 120px;
    top: calc(100% - 120px);
  }

  .store_name {
    margin-top: 5px;
  }

  .store_location {
    margin: 5px 20px;
  }

  .view-more {
    min-width: 80px;
    padding: 8px 12px;
  }

  .search {
    width: 90%;
    margin: 20px auto;
  }

  form {
    padding: 8px 15px;
  }

  input[type="text"],
  select {
    height: 40px;
    padding: 8px;
  }

  .search_button {
    padding: 10px 0;
  }

  .carousel .store {
    width: 50%;
  }
}