/**
 * Oxentra Pharma — Production Cookie Consent Stylesheet
 * Exact match to Oxentra Corporate Design Reference (Desktop & Mobile)
 */

:root {
  --ox-cc-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ox-cc-blue: #00456c;
  --ox-cc-blue-hover: #00324f;
  --ox-cc-dark: #002B3E;
  --ox-cc-orange: #F07D00;
  --ox-cc-orange-hover: #d97000;
  --ox-cc-slate-50: #f8fafc;
  --ox-cc-slate-100: #f1f5f9;
  --ox-cc-slate-200: #e2e8f0;
  --ox-cc-slate-300: #cbd5e1;
  --ox-cc-slate-400: #94a3b8;
  --ox-cc-slate-500: #64748b;
  --ox-cc-slate-600: #475569;
  --ox-cc-slate-700: #334155;
  --ox-cc-slate-800: #1e293b;
  --ox-cc-slate-900: #0f172a;
  --ox-cc-z-index: 999990;
  --ox-cc-bar-border: #e5e7eb;
  --ox-cc-bar-shadow: 0 -3px 18px rgba(0, 20, 40, 0.06);
  --ox-cc-modal-shadow: 0 20px 40px -10px rgba(0, 43, 62, 0.25), 0 0 0 1px rgba(0, 91, 130, 0.1);
}

/* Reset for consent elements */
.ox-cc-root,
.ox-cc-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--ox-cc-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Body lock when modal open */
body.ox-cc-modal-open {
  overflow: hidden !important;
}

/* ==========================================================================
   COOKIE BANNER CONTAINER (Fixed Bottom Docked)
   ========================================================================== */

.ox-cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--ox-cc-z-index);
  background: #ffffff;
  border-top: 1px solid var(--ox-cc-bar-border);
  box-shadow: var(--ox-cc-bar-shadow);
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease,
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s ease;
}

.ox-cc-banner.ox-cc-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.ox-cc-banner-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.ox-cc-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.ox-cc-banner-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eef6fa;
  color: var(--ox-cc-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.ox-cc-banner-icon svg {
  width: 20px;
  height: 20px;
}

.ox-cc-banner-text-wrap {
  flex: 1;
  min-width: 0;
}

.ox-cc-banner-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ox-cc-dark);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 2px;
}

.ox-cc-banner-desc {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ox-cc-slate-500);
  margin-bottom: 3px;
}

.ox-cc-privacy-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ox-cc-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ox-cc-privacy-link:hover {
  color: var(--ox-cc-blue-hover);
}

.ox-cc-privacy-link:focus-visible {
  outline: 2px solid var(--ox-cc-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================================
   BUTTONS (Exact Match to Design Reference)
   ========================================================================== */

.ox-cc-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ox-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  min-width: 44px;
  padding: 0 22px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.15s ease-in-out;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
}

.ox-cc-btn:focus-visible {
  outline: 2px solid var(--ox-cc-orange);
  outline-offset: 2px;
}

/* Primary Button (Accept All) */
.ox-cc-btn-primary,
.ox-cc-btn-accept,
#ox-cc-btn-accept-all {
  background: var(--ox-cc-blue);
  color: #ffffff;
  border-color: var(--ox-cc-blue);
  font-weight: 700;
  order: 3;
}

.ox-cc-btn-primary:hover,
.ox-cc-btn-accept:hover,
#ox-cc-btn-accept-all:hover {
  background: var(--ox-cc-blue-hover);
  border-color: var(--ox-cc-blue-hover);
}

/* Secondary Button (Reject Non-Essential) */
.ox-cc-btn-secondary,
.ox-cc-btn-reject,
#ox-cc-btn-reject {
  background: #ffffff;
  color: var(--ox-cc-blue);
  border-color: var(--ox-cc-blue);
  order: 2;
}

.ox-cc-btn-secondary:hover,
.ox-cc-btn-reject:hover,
#ox-cc-btn-reject:hover {
  background: #f0f7fb;
  border-color: var(--ox-cc-blue-hover);
  color: var(--ox-cc-blue-hover);
}

/* Tertiary Button (Cookie Settings) */
.ox-cc-btn-subtle,
.ox-cc-btn-settings,
#ox-cc-btn-settings {
  background: #ffffff;
  color: var(--ox-cc-blue);
  border-color: var(--ox-cc-blue);
  order: 1;
}

.ox-cc-btn-subtle:hover,
.ox-cc-btn-settings:hover,
#ox-cc-btn-settings:hover {
  background: #f0f7fb;
  border-color: var(--ox-cc-blue-hover);
  color: var(--ox-cc-blue-hover);
}

/* ==========================================================================
   MODAL DIALOG (Pfizer / Cipla Preference Centre Style)
   ========================================================================== */

.ox-cc-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--ox-cc-z-index) + 10);
  background: rgba(0, 43, 62, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease,
              visibility 0.2s ease;
}

.ox-cc-backdrop.ox-cc-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.ox-cc-modal {
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 50px);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: var(--ox-cc-modal-shadow);
  border: 1px solid var(--ox-cc-slate-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.98) translateY(8px);
  transition: opacity 0.2s ease,
              transform 0.2s ease;
}

.ox-cc-backdrop.ox-cc-visible .ox-cc-modal {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.ox-cc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px 14px 22px;
  border-bottom: 1px solid var(--ox-cc-slate-100);
}

.ox-cc-modal-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ox-cc-blue);
  margin-bottom: 2px;
}

.ox-cc-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ox-cc-dark);
  letter-spacing: -0.01em;
}

.ox-cc-modal-close-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ox-cc-slate-200);
  background: #ffffff;
  border-radius: 6px;
  color: var(--ox-cc-slate-500);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ox-cc-modal-close-btn:hover {
  background: var(--ox-cc-slate-100);
  color: var(--ox-cc-dark);
}

.ox-cc-modal-close-btn:focus-visible {
  outline: 2px solid var(--ox-cc-orange);
  outline-offset: 2px;
}

.ox-cc-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 200px);
}

.ox-cc-modal-lead {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ox-cc-slate-600);
}

/* Category cards */
.ox-cc-category-card {
  border: 1px solid var(--ox-cc-slate-200);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--ox-cc-slate-50);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ox-cc-category-card:hover {
  background: #ffffff;
  border-color: rgba(0, 69, 108, 0.3);
}

.ox-cc-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.ox-cc-category-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ox-cc-category-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ox-cc-dark);
}

.ox-cc-category-desc {
  font-size: 0.78125rem;
  line-height: 1.45;
  color: var(--ox-cc-slate-500);
}

.ox-cc-badge-always-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(0, 69, 108, 0.1);
  color: var(--ox-cc-blue);
  min-height: 26px;
}

/* Switch component */
.ox-cc-switch-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}

.ox-cc-switch {
  position: relative;
  width: 40px;
  height: 24px;
  background: var(--ox-cc-slate-300);
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  padding: 2px;
}

.ox-cc-switch:focus-visible {
  outline: 2px solid var(--ox-cc-orange);
  outline-offset: 2px;
}

.ox-cc-switch[aria-checked="true"] {
  background: var(--ox-cc-blue);
}

.ox-cc-switch-thumb {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
  transform: translateX(0);
}

.ox-cc-switch[aria-checked="true"] .ox-cc-switch-thumb {
  transform: translateX(16px);
}

.ox-cc-switch.ox-cc-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ox-cc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--ox-cc-slate-100);
  background: var(--ox-cc-slate-50);
}

/* ==========================================================================
   FOOTER TRIGGER BUTTON
   ========================================================================== */

.ox-cc-footer-trigger {
  background: transparent;
  border: none;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.ox-cc-footer-trigger:hover {
  color: #ffffff !important;
}

.ox-cc-footer-trigger:focus-visible {
  outline: 2px solid var(--ox-cc-orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Desktop / Tablet / Mobile Exact Match)
   ========================================================================== */

/* Tablet View (769px - 1199px) */
@media (max-width: 1199px) and (min-width: 769px) {
  .ox-cc-banner-container {
    padding: 16px 24px;
    gap: 20px;
  }

  .ox-cc-banner-actions {
    gap: 8px;
  }

  .ox-cc-btn {
    padding: 0 16px;
    font-size: 0.8rem;
  }
}

/* Mobile View (up to 768px — Exact Match to Mobile Mockup) */
@media (max-width: 768px) {
  .ox-cc-banner {
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.08);
  }

  .ox-cc-banner-container {
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px)) 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
  }

  .ox-cc-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
  }

  .ox-cc-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eef6fa;
    color: var(--ox-cc-blue);
    margin-top: 0;
  }

  .ox-cc-banner-icon svg {
    width: 20px;
    height: 20px;
  }

  .ox-cc-banner-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ox-cc-dark);
    line-height: 1.25;
    margin-bottom: 4px;
  }

  .ox-cc-banner-desc {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ox-cc-slate-500);
    margin-bottom: 6px;
  }

  .ox-cc-privacy-link {
    font-size: 0.78125rem;
    margin-bottom: 2px;
  }

  /* Mobile Button Stack: Accept All (Top) -> Reject (Middle) -> Settings (Bottom) */
  .ox-cc-banner-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .ox-cc-btn {
    width: 100%;
    height: 44px;
    min-height: 44px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
  }

  .ox-cc-btn-primary,
  .ox-cc-btn-accept,
  #ox-cc-btn-accept-all {
    order: 1 !important;
    font-weight: 700;
  }

  .ox-cc-btn-secondary,
  .ox-cc-btn-reject,
  #ox-cc-btn-reject {
    order: 2 !important;
  }

  .ox-cc-btn-subtle,
  .ox-cc-btn-settings,
  #ox-cc-btn-settings {
    order: 3 !important;
  }

  .ox-cc-modal {
    max-height: 92vh;
    border-radius: 14px;
  }

  .ox-cc-modal-header {
    padding: 14px 16px;
  }

  .ox-cc-modal-body {
    padding: 14px 16px;
  }

  .ox-cc-modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
    gap: 6px;
  }

  .ox-cc-modal-footer .ox-cc-btn {
    width: 100%;
    min-height: 44px;
  }
}

/* Extremely Small Mobile Screens (320px - 360px) */
@media (max-width: 360px) {
  .ox-cc-banner-container {
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
    gap: 12px;
  }

  .ox-cc-banner-icon {
    width: 32px;
    height: 32px;
  }

  .ox-cc-banner-icon svg {
    width: 18px;
    height: 18px;
  }

  .ox-cc-banner-title {
    font-size: 0.95rem;
  }

  .ox-cc-banner-desc {
    font-size: 0.75rem;
  }

  .ox-cc-banner-actions {
    gap: 8px;
  }

  .ox-cc-btn {
    height: 42px;
    min-height: 42px;
    font-size: 0.8125rem;
  }
}

/* ==========================================================================
   PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .ox-cc-banner,
  .ox-cc-backdrop,
  .ox-cc-modal,
  .ox-cc-switch,
  .ox-cc-switch-thumb,
  .ox-cc-btn {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
