/* =========================================================
   Grownex Cookie Consent Banner + Settings Modal
   ========================================================= */

.grownex-cookie-consent {
  --grownex-cookie-radius: 12px;
  position: fixed;
  z-index: 999999;
  box-sizing: border-box;
  background: var(--grownex-cookie-bg, #ffffff);
  color: var(--grownex-cookie-text, #1a1a1a);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 10px 40px rgba(19, 98, 225, 0.16);
  animation: grownexCookieIn 0.35s ease;
}

.grownex-cookie-consent[hidden] {
  display: none !important;
}

.grownex-cookie-consent * {
  box-sizing: border-box;
}

/* ---- Positions ---- */
.grownex-cookie-consent.grownex-cookie--bottom-bar {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
}

.grownex-cookie-consent.grownex-cookie--top-bar {
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
}

.grownex-cookie-consent.grownex-cookie--bottom-left {
  left: 24px;
  bottom: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  border: 1px solid #e2e2e2;
  border-radius: var(--grownex-cookie-radius);
}

.grownex-cookie-consent.grownex-cookie--bottom-right {
  right: 24px;
  bottom: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  border: 1px solid #e2e2e2;
  border-radius: var(--grownex-cookie-radius);
}

.grownex-cookie-consent__inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.grownex-cookie--bottom-left .grownex-cookie-consent__inner,
.grownex-cookie--bottom-right .grownex-cookie-consent__inner {
  flex-direction: column;
  align-items: stretch;
  padding: 22px 22px 0;
}

/* ---- Header row: heading + Settings link (box layout) ---- */
.grownex-cookie-consent__header {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 10px;
}

.grownex-cookie--bottom-left .grownex-cookie-consent__header,
.grownex-cookie--bottom-right .grownex-cookie-consent__header {
  display: flex;
}

.grownex-cookie-consent__heading {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--grownex-cookie-text, #1a1a1a);
}

.grownex-cookie-consent__settings-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 3px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  color: var(--grownex-cookie-link, #1362e1);
  white-space: nowrap;
  flex-shrink: 0;
}

.grownex-cookie-consent__settings-link:hover {
  opacity: 0.8;
}

.grownex-cookie-consent__text {
  flex: 1 1 420px;
}

.grownex-cookie-consent__text p {
  margin: 0;
  color: var(--grownex-cookie-text, #1a1a1a);
}

.grownex-cookie--bottom-left .grownex-cookie-consent__text,
.grownex-cookie--bottom-right .grownex-cookie-consent__text {
  max-height: 260px;
  overflow-y: auto;
  padding-bottom: 18px;
}

.grownex-cookie-consent__link {
  color: var(--grownex-cookie-link, #1362e1);
  text-decoration: underline;
  font-weight: 600;
  white-space: nowrap;
}

.grownex-cookie-consent__link:hover {
  opacity: 0.85;
}

.grownex-cookie-consent__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.grownex-cookie--bottom-left .grownex-cookie-consent__actions,
.grownex-cookie--bottom-right .grownex-cookie-consent__actions {
  width: 100%;
  gap: 0;
  padding: 14px 0;
  margin-top: 4px;
  border-top: 1px solid #e2e2e2;
}

.grownex-cookie--bottom-left .grownex-cookie-btn,
.grownex-cookie--bottom-right .grownex-cookie-btn {
  flex: 1 1 0;
  text-align: center;
}

.grownex-cookie--bottom-left .grownex-cookie-btn--outline,
.grownex-cookie--bottom-right .grownex-cookie-btn--outline {
  border-radius: 8px 0 0 8px;
}

.grownex-cookie--bottom-left .grownex-cookie-btn--accept,
.grownex-cookie--bottom-right .grownex-cookie-btn--accept {
  border-radius: 0 8px 8px 0;
}

/* ---- Buttons ---- */
.grownex-cookie-btn {
  cursor: pointer;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.grownex-cookie-btn--outline {
  background: transparent;
  border-color: var(--grownex-cookie-link, #1362e1);
  color: var(--grownex-cookie-link, #1362e1);
}

.grownex-cookie-btn--outline:hover {
  background: rgba(19, 98, 225, 0.08);
}

.grownex-cookie-btn--accept {
  background: var(--grownex-cookie-accept-bg, #1362e1);
  border-color: var(--grownex-cookie-accept-bg, #1362e1);
  color: var(--grownex-cookie-accept-text, #ffffff);
}

.grownex-cookie-btn--accept:hover {
  filter: brightness(1.08);
}

@keyframes grownexCookieIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   Cookie Settings Modal
   ========================================================= */

.grownex-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Inter', system-ui, sans-serif;
}

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

.grownex-cookie-modal * {
  box-sizing: border-box;
}

.grownex-cookie-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 59, 136, 0.45);
}

.grownex-cookie-modal__box {
  position: relative;
  background: #ffffff;
  color: #1a1a1a;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: grownexCookieModalIn 0.25s ease;
}

@keyframes grownexCookieModalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.grownex-cookie-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #6f747e;
}

.grownex-cookie-modal__close:hover {
  color: #1a1a1a;
}

.grownex-cookie-modal__title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
  padding-right: 24px;
}

.grownex-cookie-modal__category {
  padding: 16px 0;
  border-top: 1px solid #e2e2e2;
}

.grownex-cookie-modal__category:first-of-type {
  border-top: none;
}

.grownex-cookie-modal__category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 6px;
}

.grownex-cookie-modal__category p {
  margin: 0;
  color: #6f747e;
  font-size: 13px;
  line-height: 1.6;
}

.grownex-cookie-modal__actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.grownex-cookie-modal__actions .grownex-cookie-btn--outline {
  border-color: #1362e1;
  color: #1362e1;
}

.grownex-cookie-modal__actions .grownex-cookie-btn--outline:hover {
  background: rgba(19, 98, 225, 0.08);
}

/* ---- Toggle Switch ---- */
.grownex-cookie-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

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

.grownex-cookie-switch__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #c6c6c6;
  border-radius: 24px;
  transition: 0.2s;
}

.grownex-cookie-switch__slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.2s;
}

.grownex-cookie-switch input:checked + .grownex-cookie-switch__slider {
  background-color: #1362e1;
}

.grownex-cookie-switch input:checked + .grownex-cookie-switch__slider::before {
  transform: translateX(18px);
}

.grownex-cookie-switch--disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
  .grownex-cookie-consent__inner {
    padding: 16px;
  }

  .grownex-cookie-consent__actions {
    width: 100%;
  }

  .grownex-cookie-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .grownex-cookie-consent.grownex-cookie--bottom-left,
  .grownex-cookie-consent.grownex-cookie--bottom-right {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
  }

  .grownex-cookie-modal__box {
    padding: 24px;
  }
}
