/* ===== COOKIE CONSENT BANNER ===== */

.cookie-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99998;
  display: none;
}

.cookie-overlay.active {
  display: block;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 99999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  display: none;
  font-family: 'Lato', sans-serif;
}

.cookie-banner.active {
  display: block;
}

.cookie-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
}

.cookie-banner-inner h3 {
  font-family: 'Coustard', serif;
  font-size: 22px;
  margin: 0 0 12px;
  color: #333;
}

.cookie-banner-inner p {
  font-size: 15px;
  line-height: 1.5;
  color: #555;
  margin: 0 0 20px;
}

.cookie-banner-inner p a {
  color: #BF1E2E;
  text-decoration: underline;
}

.cookie-btn-accept {
  display: inline-block;
  background-color: #BF1E2E;
  color: #fff;
  border: none;
  padding: 14px 36px;
  font-size: 16px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cookie-btn-accept:hover {
  background-color: #a0171f;
}

.cookie-btn-manage {
  display: inline-block;
  background: none;
  border: none;
  color: #555;
  font-size: 14px;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  padding: 14px 20px;
  text-decoration: underline;
  transition: color 0.2s;
}

.cookie-btn-manage:hover {
  color: #BF1E2E;
}

.cookie-btn-reject {
  display: inline-block;
  background: none;
  border: 2px solid #999;
  color: #555;
  padding: 12px 28px;
  font-size: 15px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-btn-reject:hover {
  border-color: #BF1E2E;
  color: #BF1E2E;
}

/* ===== PREFERENCES MODAL ===== */

.cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100000;
  display: none;
  justify-content: center;
  align-items: center;
}

.cookie-modal-overlay.active {
  display: flex;
}

.cookie-modal {
  background: #fff;
  border-radius: 8px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 30px;
  position: relative;
  box-sizing: border-box;
}

.cookie-modal h3 {
  font-family: 'Coustard', serif;
  font-size: 22px;
  margin: 0 0 8px;
  color: #333;
}

.cookie-modal > p {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  margin: 0 0 24px;
}

.cookie-category {
  border-top: 1px solid #e5e5e5;
  padding: 18px 0;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-category-header h4 {
  font-family: 'Coustard', serif;
  font-size: 16px;
  margin: 0;
  color: #333;
}

.cookie-category p {
  font-size: 13px;
  line-height: 1.5;
  color: #777;
  margin: 8px 0 0;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  margin-left: 16px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.cookie-toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: #BF1E2E;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
  transform: translateX(22px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  background-color: #BF1E2E;
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-toggle-label {
  font-size: 12px;
  color: #999;
  margin-left: 8px;
  white-space: nowrap;
}

.cookie-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.cookie-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 4px;
}

.cookie-modal-close:hover {
  color: #333;
}

.cookie-btn-save {
  display: inline-block;
  background-color: #BF1E2E;
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cookie-btn-save:hover {
  background-color: #a0171f;
}

/* Hide fixed UI elements (phone banner, floating basket) when consent UI is showing */
body.cookie-active .phone-number,
body.cookie-active .floating-basket {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
  .cookie-banner-inner {
    padding: 24px 16px;
  }

  .cookie-banner-inner h3 {
    font-size: 19px;
  }

  .cookie-banner-inner p {
    font-size: 14px;
  }

  .cookie-btn-accept {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
  }

  .cookie-btn-manage {
    display: block;
    width: 100%;
    padding: 10px;
  }

  .cookie-modal-overlay {
    align-items: flex-start;
    padding: 16px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cookie-modal {
    padding: 20px;
    width: 95%;
    max-height: none;
    margin: 0 auto;
  }

  .cookie-modal-actions {
    flex-direction: column;
  }

  .cookie-btn-reject,
  .cookie-btn-save {
    width: 100%;
    text-align: center;
  }
}
