/* ==========================================================================
   TIRAZO Cookie Consent & Privacy Controls System
   Matches canonical brand tokens: Charcoal #0B1013, Lime #D5FB46, Lilac #C7A1F8
   Accessible, responsive (320px+), safe-area compliant
   ========================================================================== */

/* Banner Container */
#tirazo-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99990;
  background: rgba(11, 16, 19, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(213, 251, 70, 0.35);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
  padding: 18px 24px max(18px, env(safe-area-inset-bottom));
  transform: translateY(0);
  transition: transform 0.28s ease, opacity 0.25s ease;
  color: #F4F5EF;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#tirazo-cookie-banner.consent-hidden {
  display: none !important;
}

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner-copy {
  flex: 1 1 520px;
}

.cookie-banner-title {
  display: block;
  font-family: "Barlow Condensed Black", "Barlow Condensed", sans-serif;
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #D5FB46;
  margin-bottom: 4px;
}

.cookie-banner-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #CBD5E1;
}

.cookie-banner-text a {
  color: #D5FB46;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-banner-text a:hover {
  color: #FFFFFF;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Skewed Buttons */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  font-family: "Barlow Condensed Black", "Barlow Condensed", sans-serif;
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transform: skewX(-4deg);
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.cookie-btn:focus-visible {
  outline: 2px solid #D5FB46;
  outline-offset: 3px;
}

.cookie-btn-primary {
  background: #D5FB46;
  color: #0B1013;
  box-shadow: 0 0 16px rgba(213, 251, 70, 0.25);
}
.cookie-btn-primary:hover {
  filter: brightness(1.1);
  transform: skewX(-4deg) scale(1.02);
}

.cookie-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #F4F5EF;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  transform: skewX(-4deg) scale(1.02);
}

.cookie-btn-purple {
  background: #C7A1F8;
  color: #0B1013;
  box-shadow: 0 0 16px rgba(199, 161, 248, 0.25);
}
.cookie-btn-purple:hover {
  filter: brightness(1.1);
  transform: skewX(-4deg) scale(1.02);
}

/* Modal Overlay & Dialog */
#tirazo-cookie-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

#tirazo-cookie-dialog-overlay.consent-hidden {
  display: none !important;
}

.cookie-dialog-card {
  width: 100%;
  max-width: 660px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #151D22;
  border: 1px solid rgba(213, 251, 70, 0.35);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  padding: 22px 24px;
  color: #F4F5EF;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative;
}

.cookie-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.cookie-dialog-title {
  margin: 0;
  font-family: "Barlow Condensed Black", "Barlow Condensed", sans-serif;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #D5FB46;
}

.cookie-dialog-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #8F9FA4;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.cookie-dialog-close:hover {
  color: #FFFFFF;
  border-color: #D5FB46;
  background: rgba(213, 251, 70, 0.1);
}

.cookie-dialog-body {
  overflow-y: auto;
  padding-right: 6px;
  flex: 1 1 auto;
}

.cookie-dialog-body::-webkit-scrollbar {
  width: 6px;
}
.cookie-dialog-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.cookie-dialog-intro {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #CBD5E1;
}

/* Category Cards */
.cookie-category {
  background: #0E1418;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.cookie-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.cookie-category-name {
  font-family: "Barlow Condensed Black", "Barlow Condensed", sans-serif;
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  color: #F4F5EF;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Badges */
.cookie-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: "Barlow Condensed Black", "Barlow Condensed", sans-serif;
  font-size: 11px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cookie-badge-green {
  background: rgba(213, 251, 70, 0.12);
  border: 1px solid rgba(213, 251, 70, 0.4);
  color: #D5FB46;
}

.cookie-badge-gray {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #8F9FA4;
}

/* Custom Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 26px;
  transition: 0.2s ease;
}

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

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

.cookie-toggle input:checked + .cookie-slider::before {
  transform: translateX(22px);
  background-color: #0B1013;
}

.cookie-toggle input:disabled + .cookie-slider {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Dialog Actions */
.cookie-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Trigger Button for Footers */
.cookie-settings-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.cookie-settings-btn:hover {
  color: #D5FB46 !important;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  #tirazo-cookie-banner {
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  }
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .cookie-banner-actions {
    width: 100%;
    flex-direction: column;
  }
  .cookie-banner-actions .cookie-btn {
    width: 100%;
  }
  .cookie-dialog-card {
    padding: 20px 16px;
  }
  .cookie-dialog-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-dialog-actions .cookie-btn {
    width: 100%;
  }
}


@media (max-width: 480px) {
  #tirazo-cookie-banner {
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  }
  .cookie-banner-inner {
    gap: 10px;
  }
  .cookie-banner-title {
    font-size: 17px;
    margin-bottom: 2px;
    letter-spacing: 0.04em;
  }
  .cookie-banner-text {
    font-size: 12px;
    line-height: 1.45;
  }
  .cookie-banner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .cookie-banner-actions #consent-accept-btn {
    grid-column: 1;
    min-height: 44px;
    padding: 0 6px;
    font-size: 13.5px;
    letter-spacing: 0.03em;
    width: 100%;
  }
  .cookie-banner-actions #consent-reject-btn {
    grid-column: 2;
    min-height: 44px;
    padding: 0 6px;
    font-size: 13.5px;
    letter-spacing: 0.03em;
    width: 100%;
  }
  .cookie-banner-actions #consent-customize-btn {
    grid-column: 1 / -1;
    min-height: 36px;
    padding: 0 12px;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(199, 161, 248, 0.45);
    color: #C7A1F8;
    box-shadow: none;
  }
  .cookie-banner-actions #consent-customize-btn:hover {
    background: rgba(199, 161, 248, 0.15);
    color: #FFFFFF;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tirazo-cookie-banner,
  #tirazo-cookie-dialog-overlay,
  .cookie-btn,
  .cookie-slider,
  .cookie-slider::before {
    transition: none !important;
  }
}

.cookie-settings-btn,#consent-customize-btn{min-height:44px}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){
  #tirazo-cookie-banner,.cookie-dialog-card{background:#0B1013;backdrop-filter:none;-webkit-backdrop-filter:none}
  .cookie-btn{border-color:currentColor}
}
