
/* Reset default browser styles */

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

/* Global page styles */

body {
  font-family: Arial, sans-serif;
  background-color: #e7c69e;
  color: #682b08;
}

/* Gallery grid */

.gallery {
  display: grid;

  grid-template-columns: repeat(
    auto-fill,
    minmax(250px, 280px)
  );

  justify-content: center;

  gap: 20px;
  padding: 20px;
}

/* Product cards */

.card {
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 20px;

  width: 100%;
  max-width: 280px;

  padding: 15px;

  background-color: #745347;
  border-radius: 10px;

  text-align: center;

  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

  transition: transform 0.3s ease;

  cursor: pointer;
}

/* Product ID */

.id {
  position: absolute;
  right: 5px;
  bottom: 5px;

  font-size: 15px;
  color: rgb(74, 4, 4);
}

/* Card hover effect */

.card:hover {
  transform: scale(1.05);
}

/* Product images */
.card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* Product text */

.card p {
  font-size: 24px;
  color: #e7c69e;

  font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
}

/* Modal window */

.modal-content {
  position: fixed;
  bottom: 15%;
  left: 15%;

  z-index: 600;

  display: flex;
  flex-direction: column;

  width: 70%;
  height: 70%;
  padding: 20px;

  background-color: #e7c69e;
  border: 2px solid #682b08;
  border-radius: 10px;

  font-size: 20px;
  overflow: hidden;
}

.modal-details {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
  padding-bottom: 12px;
  margin-bottom: 100px;
  scrollbar-width: thin;
  scrollbar-color: #682b08 #f3dfbf;
}

.modal-details::-webkit-scrollbar {
  width: 10px;
}

.modal-details::-webkit-scrollbar-track {
  background: #f3dfbf;
  border: 1px solid #d4b48a;
  border-radius: 10px;
}

.modal-details::-webkit-scrollbar-thumb {
  background: #682b08;
  border: 1px solid #4a1f06;
  border-radius: 10px;
}

.modal-details::-webkit-scrollbar-thumb:hover {
  background: #803a11;
}

.modal-content p {
  margin: 0 0 18px;
  line-height: 1.6;
}

.modal-taste,
.modal-ingredients,
.modal-size {
  display: block;
  margin-top: 8px;
  line-height: 1.65;
  white-space: pre-line;
}

/* Close modal button */

.close {
  padding-left: 96%;

  font-size: 40px;

  cursor: pointer;
}

/* Order button container */

.button {
  position: absolute;
  bottom: 0;

  display: flex;
  justify-content: center;
  align-items: flex-start;

  width: 100%;
  height: 100px;
  padding: 20px;
}

/* Modal order button */

.modal-button {
  width: 50%;
  height: 50px;

  background: linear-gradient(
    45deg,
    #984413,
    #682b08,
    #984413
  );

  color: #e7c69e;

  font-size: 24px;

  border: none;
  border-radius: 10px;

  cursor: pointer;

  box-shadow: 5px 5px 5px rgba(24, 7, 0, 0.7);

  animation: goldShine 5s ease infinite;
}

/* Modal button hover effect */

.modal-button:hover {
  background-color: #803a11;

  transform: scale(1.1);
  transition: transform 0.2s;
}

/* Order form overlay */

.box-order-form {
  position: fixed;
  top: 0;
  left: 0;

  z-index: 1000;

  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  height: 100%;

  background-color: rgba(0, 0, 0, 0.6);
}

/* Order form window */

.order-form {
  position: relative;

  display: flex;
  flex-direction: column;
  gap: 15px;

  width: 520px;
  padding: 25px 30px;

  background-color: #fbe5c9;
  border-radius: 12px;

  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Order form title */

.name-form h2 {
  margin-bottom: 10px;

  color: #333;

  font-size: 20px;
  text-align: center;
}

/* Form labels */

.order-form label {
  display: flex;
  flex-direction: column;

  color: #5b0606;

  font-size: 14px;
}

/* Form inputs */

.order-form input {
  margin-top: 5px;
  padding: 10px;

  border: 1px solid #ccc;
  border-radius: 8px;

  font-size: 14px;
}

/* Input focus effect */

.order-form input:focus {
  outline: none;

  border-color: #682b08;

  box-shadow: 0 0 4px #250f02;
}

/* Submit order button */

.order-btn {
  padding: 12px;

  background-color: #682b08;

  color: #e7c69e;

  border: none;
  border-radius: 8px;

  font-size: 16px;

  cursor: pointer;

  transition: 0.2s ease;
}

/* Submit button hover effect */

.order-btn:hover {
  background-color: #fe8c01;
  color: #682b08;
}

/* Close order form button */

.close-order {
  position: absolute;
  top: 10px;
  right: 15px;

  color: #888;

  font-size: 28px;
  font-weight: bold;

  cursor: pointer;

  transition: 0.2s;
}

/* Close order button hover effect */

.close-order:hover {
  color: #000;
}

@media (max-width: 768px) {
  .modal-content {
    top: 50%;
    left: 50%;
    bottom: auto;

    width: calc(100% - 32px);
    max-width: 420px;
    height: auto;
    max-height: 85vh;

    transform: translate(-50%, -50%);
    overflow-y: auto;

    padding: 20px;
  }

  .close {
    align-self: flex-end;
    padding-left: 0;
    font-size: 32px;
  }

  .button {
    position: static;

    width: 100%;
    height: auto;
    padding: 20px 0 0;
  }

  .modal-button {
    width: 100%;
    max-width: 220px;
  }
}

@media (min-width: 769px) and (max-width: 1368px) and (min-height: 601px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    width: 100%;
    max-width: 100%;
  }

  .card p {
    font-size: 20px;
  }

  .modal-content {
    top: 50%;
    left: 50%;
    bottom: auto;

    width: min(85%, 720px);
    height: auto;
    max-height: 80vh;

    transform: translate(-50%, -50%);
    overflow-y: auto;
  }

  .close {
    align-self: flex-end;
    padding-left: 0;
  }

  .button {
    position: static;
    width: 100%;
    height: auto;
    padding: 20px 0 0;
  }

  .modal-button {
    width: 100%;
    max-width: 280px;
  }

  .order-form {
    width: min(520px, calc(100% - 48px));
  }
}
