
/* Reset default browser styles */

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

/* Global page styles */

body {
  font-family: Arial, sans-serif;
  background-color: var(--public-primary-color, #e7c69e);
  color: var(--public-divider-color, #682b08);
}

/* Gallery grid */

.gallery {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, 260px), 1fr)
  );
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  padding: 20px;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Product cards */

.card {
  position: relative;

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

  width: 100%;
  max-width: 100%;

  padding: 15px;

  background-color: var(--public-card-color, #745347);
  border-radius: 10px;

  text-align: center;

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

  transition: transform 0.3s ease;
}

/* 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.02);
}

.card-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  padding: 8px;

  background-color: rgba(231, 198, 158, 0.12);
  border-radius: 10px;
}

/* Product images */
.card img,
.card .foto {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

/* Product text */

.card p {
  font-size: 24px;
  color: var(--public-card-text-color, #e7c69e);

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

.card-name {
  font-weight: bold;
}

.card-learn-more {
  align-self: center;

  min-width: 180px;
  padding: 10px 18px;

  background: var(--public-button-color, #984413);
  color: var(--public-button-text-color, #e7c69e);

  border: none;
  border-radius: 10px;

  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: bold;

  cursor: pointer;

  box-shadow: 0 4px 8px rgba(24, 7, 0, 0.35);

  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.card-learn-more:hover {
  transform: translateY(-1px);
  background-color: #803a11;
}

.card-learn-more:focus-visible {
  outline: 2px solid #e7c69e;
  outline-offset: 3px;
}

/* Modal window */

.modal {
  display: none;
}

.modal.is-open {
  display: flex;
}

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

  z-index: 600;

  display: flex;
  flex-direction: column;

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

  background-color: var(--public-primary-color, #e7c69e);
  border: 2px solid var(--public-divider-color, #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-description,
.modal-taste,
.modal-ingredients,
.modal-size {
  display: block;
  margin-top: 8px;
  line-height: 1.65;
  white-space: pre-line;
}

.modal-field[hidden] {
  display: none !important;
}

/* Close modal button */

.close {
  align-self: flex-end;

  margin: 0 0 8px;
  padding: 4px 8px;

  background: transparent;
  border: none;

  color: #682b08;

  font-size: 40px;
  line-height: 1;

  cursor: pointer;

  border-radius: 8px;
}

.close:hover {
  color: #984413;
  background-color: rgba(104, 43, 8, 0.08);
}

.close:focus-visible,
.modal-button:focus-visible {
  outline: 2px solid #984413;
  outline-offset: 3px;
}

/* 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: var(--public-button-color, #984413);
  color: var(--public-button-text-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: none;
  justify-content: center;
  align-items: center;

  width: 100%;
  height: 100%;

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

.box-order-form.is-open {
  display: flex;
}

/* 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;
}

.order-datetime-fields {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.order-datetime-fields input[type="date"],
.order-datetime-fields select {
  box-sizing: border-box;
  min-height: 42px;
  margin-top: 0;
  padding: 10px;

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

  font-size: 14px;
  background-color: #fff;
}

.order-datetime-fields input[type="date"] {
  flex: 1;
  min-width: 0;
}

.order-datetime-fields select {
  flex: 0 0 140px;
  width: 140px;
  cursor: pointer;
}

.order-datetime-fields input[type="date"]:focus,
.order-datetime-fields select:focus {
  outline: none;

  border-color: #682b08;

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

/* Submit order button */

.order-btn {
  padding: 12px;

  background-color: var(--public-button-color, #682b08);
  color: var(--public-button-text-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;
}

/* Order success modal */

.order-success-modal {
  position: fixed;
  top: 0;
  left: 0;

  z-index: 1100;

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

  width: 100%;
  height: 100%;
  padding: 16px;

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

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.order-success-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.order-success-modal__content {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;

  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;

  padding: 36px 32px 32px;

  background-color: #fbe5c9;
  color: #682b08;

  border: 2px solid #682b08;
  border-radius: 14px;

  box-shadow: 0 8px 28px rgba(40, 16, 4, 0.35);

  text-align: center;

  transform: translateY(12px) scale(0.98);

  transition: transform 0.25s ease;
}

.order-success-modal.is-open .order-success-modal__content {
  transform: translateY(0) scale(1);
}

.order-success-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;

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

  width: 40px;
  height: 40px;
  padding: 0;

  background: transparent;
  border: none;

  color: #682b08;

  font-size: 32px;
  line-height: 1;

  cursor: pointer;

  border-radius: 8px;

  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.order-success-modal__close:hover {
  color: #984413;
  background-color: rgba(104, 43, 8, 0.08);
}

.order-success-modal__close:focus-visible,
.order-success-modal__button:focus-visible {
  outline: 2px solid #984413;
  outline-offset: 3px;
}

.order-success-modal__icon {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 64px;
  height: 64px;
  margin: 8px 0 18px;

  background: linear-gradient(145deg, #984413, #682b08);
  color: #fbe5c9;

  border-radius: 50%;

  font-size: 34px;
  font-weight: bold;
  line-height: 1;

  box-shadow: 0 4px 12px rgba(104, 43, 8, 0.35);
}

.order-success-modal__title {
  margin: 0 0 16px;

  color: #682b08;

  font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
  font-size: 28px;
  font-weight: bold;
  line-height: 1.3;
}

.order-success-modal__message {
  margin: 0 0 28px;

  color: #5b0606;

  font-size: 16px;
  line-height: 1.65;
}

.order-success-modal__message p {
  margin: 0 0 14px;
}

.order-success-modal__message p:last-child {
  margin-bottom: 0;
  color: #682b08;
  font-style: italic;
}

.order-success-modal__button {
  min-width: 180px;
  padding: 14px 28px;

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

  border: none;
  border-radius: 10px;

  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.02em;

  cursor: pointer;

  box-shadow: 0 4px 12px rgba(40, 16, 4, 0.3);

  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.order-success-modal__button:hover {
  background-color: #803a11;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(40, 16, 4, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .order-success-modal,
  .order-success-modal__content,
  .order-success-modal__close,
  .order-success-modal__button {
    transition: none;
  }

  .order-success-modal__content {
    transform: none;
  }

  .order-success-modal.is-open .order-success-modal__content {
    transform: none;
  }

  .order-success-modal__button:hover {
    transform: none;
  }
}

@media (max-width: 520px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px 16px;
  }

  .card {
    width: 100%;
  }

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

  .card-learn-more {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .order-success-modal {
    padding: 12px;
  }

  .order-success-modal__content {
    max-width: none;
    width: calc(100% - 8px);
    padding: 32px 20px 24px;
  }

  .order-success-modal__title {
    font-size: 24px;
  }

  .order-success-modal__message {
    font-size: 15px;
  }

  .order-success-modal__button {
    width: 100%;
    min-width: 0;
  }
}

@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;
  }

  .order-datetime-fields {
    flex-direction: column;
    align-items: stretch;
  }

  .order-datetime-fields select {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1368px) and (min-height: 601px) {
  .gallery {
    grid-template-columns: repeat(
      auto-fill,
      minmax(min(100%, 220px), 1fr)
    );
    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));
  }
}
