/**
 * TEX-MA OOD Cookie Consent — Styles
 * Дизайн в духа на t-shirt-bg.com
 * Използва същите CSS променливи като сайта
 */

/* ==========================================
   ROOT VARIABLES (от основния сайт)
   ========================================== */
.texma-cc-container,
.texma-cs-container,
.texma-cookie-reopen {
  --cc-cream: #f7f5f0;
  --cc-warm: #ede9e0;
  --cc-white: #ffffff;
  --cc-ink: #1a1a18;
  --cc-ink-soft: #4a4a45;
  --cc-ink-muted: #8a8a82;
  --cc-gold: #c8a96e;
  --cc-gold-dark: #9a7d48;
  --cc-gold-light: #e8d5a8;
  --cc-border: rgba(26, 26, 24, 0.1);
  --cc-border-strong: rgba(26, 26, 24, 0.2);
  --cc-overlay: rgba(26, 26, 24, 0.55);
  --cc-shadow: 0 8px 32px rgba(26, 26, 24, 0.15);
  --cc-radius: 8px;
  --cc-radius-sm: 4px;
  --cc-font-serif: 'Playfair Display', Georgia, serif;
  --cc-font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================
   MODAL OVERLAY (първо посещение)
   ========================================== */
.texma-cc-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--cc-overlay);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--cc-font-sans);
  animation: texmaCCFadeIn 0.3s ease-out;
}

@keyframes texmaCCFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.texma-cc-modal {
  background: var(--cc-cream);
  max-width: 500px;
  width: 100%;
  border-radius: var(--cc-radius);
  padding: 32px;
  box-shadow: var(--cc-shadow);
  border: 1px solid var(--cc-border);
  animation: texmaCCSlideUp 0.4s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.texma-cc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.texma-cc-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.texma-cc-title {
  font-family: var(--cc-font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--cc-ink);
  margin: 0;
  line-height: 1.3;
}

.texma-cc-text {
  font-size: 14px;
  color: var(--cc-ink-soft);
  line-height: 1.6;
  margin: 0 0 24px;
}

.texma-cc-text a {
  color: var(--cc-gold-dark);
  text-decoration: underline;
}

.texma-cc-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.texma-cc-btn {
  flex: 1;
  min-width: 130px;
  padding: 12px 20px;
  border-radius: var(--cc-radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--cc-font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-align: center;
}

.texma-cc-btn-reject {
  background: transparent;
  color: var(--cc-ink);
  border-color: var(--cc-border-strong);
}

.texma-cc-btn-reject:hover {
  background: var(--cc-warm);
  border-color: var(--cc-ink-soft);
}

.texma-cc-btn-settings-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--cc-ink-soft);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 8px;
  background: transparent;
  border: none;
  width: 100%;
  font-family: var(--cc-font-sans);
}

.texma-cc-btn-settings-link:hover {
  color: var(--cc-ink);
}

.texma-cc-btn-accept {
  background: var(--cc-gold);
  color: var(--cc-ink);
  border-color: var(--cc-gold);
}

.texma-cc-btn-accept:hover {
  background: var(--cc-gold-dark);
  color: var(--cc-cream);
  border-color: var(--cc-gold-dark);
}

.texma-cc-footer {
  font-size: 11px;
  color: var(--cc-ink-muted);
  line-height: 1.5;
  text-align: center;
  padding-top: 16px;
  border-top: 0.5px solid var(--cc-border);
}

.texma-cc-footer a {
  color: var(--cc-ink-soft);
  text-decoration: underline;
}

/* ==========================================
   SETTINGS PANEL
   ========================================== */
.texma-cs-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--cc-overlay);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--cc-font-sans);
  animation: texmaCCFadeIn 0.3s ease-out;
  overflow-y: auto;
}

.texma-cs-modal {
  background: var(--cc-cream);
  max-width: 540px;
  width: 100%;
  border-radius: var(--cc-radius);
  padding: 28px;
  box-shadow: var(--cc-shadow);
  border: 1px solid var(--cc-border);
  animation: texmaCCSlideUp 0.4s ease-out;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.texma-cs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.texma-cs-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.texma-cs-icon {
  font-size: 22px;
}

.texma-cs-title {
  font-family: var(--cc-font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--cc-ink);
  margin: 0;
}

.texma-cs-btn-close {
  background: transparent;
  border: none;
  color: var(--cc-ink-soft);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 20px;
  line-height: 1;
  border-radius: var(--cc-radius-sm);
  transition: all 0.2s;
}

.texma-cs-btn-close:hover {
  background: var(--cc-warm);
  color: var(--cc-ink);
}

.texma-cs-subtitle {
  font-size: 13px;
  color: var(--cc-ink-soft);
  line-height: 1.5;
  margin: 0 0 20px;
}

.texma-cs-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.texma-cs-category {
  background: var(--cc-white);
  border: 0.5px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  padding: 14px 16px;
}

.texma-cs-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.texma-cs-cat-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--cc-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.texma-cs-cat-icon {
  font-size: 16px;
  color: var(--cc-gold-dark);
}

.texma-cs-cat-desc {
  font-size: 12px;
  color: var(--cc-ink-soft);
  line-height: 1.5;
  margin: 0;
}

.texma-cs-cat-cookies {
  font-size: 11px;
  color: var(--cc-ink-muted);
  margin-top: 6px;
  font-style: italic;
}

/* Toggle switch */
.texma-cs-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.texma-cs-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cc-border-strong);
  border-radius: 22px;
  transition: 0.3s;
}

.texma-cs-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--cc-white);
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.texma-cs-toggle input:checked + .texma-cs-toggle-slider {
  background: var(--cc-gold);
}

.texma-cs-toggle input:checked + .texma-cs-toggle-slider:before {
  transform: translateX(18px);
}

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

.texma-cs-toggle-locked {
  font-size: 11px;
  color: var(--cc-gold-dark);
  font-weight: 500;
  white-space: nowrap;
}

.texma-cs-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.texma-cs-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border-radius: var(--cc-radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--cc-font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.texma-cs-btn-save {
  background: transparent;
  color: var(--cc-ink);
  border-color: var(--cc-border-strong);
}

.texma-cs-btn-save:hover {
  background: var(--cc-warm);
  border-color: var(--cc-ink-soft);
}

.texma-cs-btn-accept-all {
  background: var(--cc-gold);
  color: var(--cc-ink);
  border-color: var(--cc-gold);
}

.texma-cs-btn-accept-all:hover {
  background: var(--cc-gold-dark);
  color: var(--cc-cream);
  border-color: var(--cc-gold-dark);
}

/* ==========================================
   FLOATING REOPEN BUTTON
   ========================================== */
.texma-cookie-reopen {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cc-cream);
  border: 1px solid var(--cc-border-strong);
  cursor: pointer;
  z-index: 99998;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 12px rgba(26, 26, 24, 0.1);
  transition: all 0.2s ease;
  font-family: var(--cc-font-sans);
}

.texma-cookie-reopen:hover {
  background: var(--cc-warm);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(26, 26, 24, 0.15);
}

.texma-cookie-reopen:active {
  transform: scale(0.98);
}

.texma-cookie-reopen-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--cc-ink);
  color: var(--cc-cream);
  padding: 6px 12px;
  border-radius: var(--cc-radius-sm);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.texma-cookie-reopen:hover .texma-cookie-reopen-tooltip {
  opacity: 1;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 600px) {
  .texma-cc-modal,
  .texma-cs-modal {
    padding: 20px;
  }

  .texma-cc-title {
    font-size: 18px;
  }

  .texma-cs-title {
    font-size: 16px;
  }

  .texma-cc-text {
    font-size: 13px;
  }

  .texma-cc-btn,
  .texma-cs-btn {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .texma-cookie-reopen {
    bottom: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}