/*!
 * HITESA Cookie Consent — Styles v1.1
 * HISPANO ITALIANA DE TRENZADOS ESPECIALES, S.A.
 * LOPDGDD + ePrivacy + RGPD Compliant
 */

/* ============================================================
   VARIABLES
   ============================================================ */
#hc-banner,
#hc-preferences-overlay,
.hc-blocked-content,
#hc-badge {
  --hc-gold:        #b4963a;
  --hc-gold-hover:  #c9a94d;
  --hc-gold-dark:   #957c2e;
  --hc-gold-dim:    rgba(180,150,58,0.10);
  --hc-black:       #0f0f0f;
  --hc-dark:        #1a1a1a;
  --hc-dark2:       #242424;
  --hc-dark3:       #2e2e2e;
  --hc-white:       #ffffff;
  --hc-off-white:   #f9f7f2;
  --hc-text:        #1a1a1a;
  --hc-text-mid:    #555555;
  --hc-text-light:  #888888;
  --hc-border:      #e5e5e5;
  --hc-font:        'Helvetica Neue', Helvetica, Arial, sans-serif;
  --hc-radius:      2px;
  --hc-ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================
   BANNER — fondo blanco
   ============================================================ */
#hc-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999990;
  background: var(--hc-white);
  color: var(--hc-text);
  font-family: var(--hc-font);
  font-size: 13px;
  line-height: 1.5;
  border-top: 3px solid var(--hc-gold);
  box-shadow: 0 -4px 28px rgba(0,0,0,0.12);
  transform: translateY(110%);
  transition: transform 0.4s var(--hc-ease);
}
#hc-banner.hc-visible { transform: translateY(0); }

#hc-banner-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

/* Logo mark */
#hc-banner-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#hc-brand-mark {
  width: 36px; height: 36px;
  border: 1.5px solid var(--hc-gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#hc-brand-mark svg { width: 18px; height: 18px; fill: var(--hc-gold); }

/* Text */
#hc-banner-text { flex: 1; min-width: 220px; }
#hc-banner-text h3 {
  margin: 0 0 3px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--hc-gold);
}
#hc-banner-text p { margin: 0; font-size: 13px; color: var(--hc-text-mid); line-height: 1.55; }
#hc-banner-text a {
  color: var(--hc-gold-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(180,150,58,0.4);
  transition: color 0.2s, border-color 0.2s;
}
#hc-banner-text a:hover { color: var(--hc-gold); border-color: var(--hc-gold); }

/* Actions */
#hc-banner-actions {
  display: flex; align-items: center;
  gap: 8px; flex-shrink: 0; flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.hc-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  padding: 9px 18px;
  border: 1.5px solid transparent;
  border-radius: var(--hc-radius);
  font-family: var(--hc-font);
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
  line-height: 1;
}
.hc-btn:focus-visible { outline: 2px solid var(--hc-gold); outline-offset: 2px; }

/* Primario — relleno dorado */
.hc-btn-primary {
  background: var(--hc-gold);
  color: var(--hc-black);
  border-color: var(--hc-gold);
}
.hc-btn-primary:hover {
  background: var(--hc-gold-hover);
  border-color: var(--hc-gold-hover);
  transform: translateY(-1px);
}

/* Contorno dorado — para botones secundarios en fondo blanco */
.hc-btn-outline-gold {
  background: transparent;
  color: var(--hc-gold-dark);
  border-color: var(--hc-gold);
}
.hc-btn-outline-gold:hover {
  background: var(--hc-gold-dim);
  border-color: var(--hc-gold-dark);
  transform: translateY(-1px);
}

/* Outline light — modal */
.hc-btn-outline-light {
  background: transparent;
  color: var(--hc-text);
  border-color: #cccccc;
}
.hc-btn-outline-light:hover { border-color: var(--hc-gold); color: var(--hc-gold-dark); }

/* Ghost link — footer modal */
.hc-btn-ghost-dark {
  background: transparent;
  color: var(--hc-text-mid);
  border-color: transparent;
  font-size: 11px; letter-spacing: 0.5px;
  text-transform: none; font-weight: 400;
  padding: 9px 8px;
}
.hc-btn-ghost-dark:hover { color: var(--hc-gold-dark); }

/* ============================================================
   OVERLAY
   ============================================================ */
#hc-preferences-overlay {
  position: fixed; inset: 0;
  z-index: 1000000;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
  font-family: var(--hc-font);
}
#hc-preferences-overlay.hc-visible { opacity: 1; pointer-events: all; }

/* ============================================================
   MODAL
   ============================================================ */
#hc-modal {
  background: var(--hc-white);
  width: 100%; max-width: 580px; max-height: 88vh;
  overflow: hidden; display: flex; flex-direction: column;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  border-top: 3px solid var(--hc-gold);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s var(--hc-ease);
}
#hc-preferences-overlay.hc-visible #hc-modal { transform: translateY(0) scale(1); }

#hc-modal-header {
  background: var(--hc-dark);
  padding: 22px 28px 18px;
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--hc-dark3);
  flex-shrink: 0;
}
#hc-modal-header-text h2 {
  margin: 0 0 4px; font-size: 15px; font-weight: 700;
  color: var(--hc-white); letter-spacing: 0.3px;
}
#hc-modal-header-text p { margin: 0; font-size: 12px; color: #888; line-height: 1.5; }
#hc-modal-close {
  background: none; border: none; color: #666;
  cursor: pointer; font-size: 18px; line-height: 1;
  padding: 2px 4px; flex-shrink: 0;
  transition: color 0.15s; font-family: var(--hc-font);
}
#hc-modal-close:hover { color: var(--hc-white); }

#hc-modal-body { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
#hc-modal-body::-webkit-scrollbar { width: 4px; }
#hc-modal-body::-webkit-scrollbar-track { background: var(--hc-border); }
#hc-modal-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.hc-category { padding: 18px 28px; border-bottom: 1px solid var(--hc-border); }
.hc-category:last-child { border-bottom: none; }
.hc-category-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 20px; margin-bottom: 8px;
}
.hc-category-name {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--hc-text);
}
.hc-category p { margin: 0; font-size: 12.5px; color: var(--hc-text-mid); line-height: 1.6; }
.hc-always-on {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--hc-gold);
  white-space: nowrap; flex-shrink: 0;
}

/* Toggle */
.hc-toggle { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.hc-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.hc-toggle-track {
  display: block; width: 42px; height: 22px; border-radius: 11px;
  background: #d0d0d0; transition: background 0.2s ease;
  position: relative; cursor: pointer;
}
.hc-toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}
.hc-toggle input:checked + .hc-toggle-track { background: var(--hc-gold); }
.hc-toggle input:checked + .hc-toggle-track::after { transform: translateX(20px); }
.hc-toggle input:focus-visible + .hc-toggle-track { outline: 2px solid var(--hc-gold); outline-offset: 2px; }

#hc-modal-footer {
  flex-shrink: 0; padding: 14px 28px;
  background: var(--hc-off-white); border-top: 1px solid var(--hc-border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
}
#hc-modal-footer-left { margin-right: auto; }

/* ============================================================
   BLOCKED CONTENT
   ============================================================ */
.hc-blocked-content {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--hc-dark); padding: 36px 24px;
  text-align: center; min-height: 200px;
  font-family: var(--hc-font);
  border: 1px solid var(--hc-dark3);
  width: 100%; box-sizing: border-box;
}
.hc-blocked-icon {
  width: 44px; height: 44px;
  border: 1.5px solid var(--hc-gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.hc-blocked-icon svg { width: 20px; height: 20px; fill: var(--hc-gold); }
.hc-blocked-content h4 {
  margin: 0 0 6px; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--hc-white);
}
.hc-blocked-content p { margin: 0 0 18px; font-size: 12px; color: #888; max-width: 280px; line-height: 1.6; }
.hc-blocked-btn {
  background: var(--hc-gold); color: var(--hc-black); border: none;
  padding: 9px 20px; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  border-radius: var(--hc-radius); font-family: var(--hc-font);
  transition: background 0.18s;
}
.hc-blocked-btn:hover { background: var(--hc-gold-hover); }

/* ============================================================
   BADGE — esquina inferior DERECHA
   ============================================================ */
#hc-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999989;
  width: 38px; height: 38px;
  background: var(--hc-white);
  border: 1.5px solid var(--hc-gold);
  border-radius: var(--hc-radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, background 0.18s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(180,150,58,0.2);
}
#hc-badge.hc-visible { opacity: 1; pointer-events: all; }
#hc-badge:hover { background: var(--hc-gold); transform: scale(1.06); }
#hc-badge svg { width: 18px; height: 18px; fill: var(--hc-gold); transition: fill 0.18s; }
#hc-badge:hover svg { fill: var(--hc-black); }
#hc-badge-tooltip {
  position: absolute;
  right: 46px; bottom: 4px;
  background: var(--hc-dark); color: var(--hc-white);
  font-family: var(--hc-font); font-size: 11px;
  padding: 5px 10px; white-space: nowrap;
  border: 1px solid var(--hc-dark3);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  border-radius: var(--hc-radius);
}
#hc-badge:hover #hc-badge-tooltip { opacity: 1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  #hc-banner-inner { padding: 16px 20px; flex-direction: column; align-items: flex-start; gap: 14px; }
  #hc-banner-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #hc-banner-actions #hc-btn-accept { grid-column: 1 / -1; }
  #hc-modal-header { padding: 18px 20px 14px; }
  #hc-modal-body .hc-category { padding: 16px 20px; }
  #hc-modal-footer { padding: 12px 20px; flex-direction: column; }
  #hc-modal-footer .hc-btn { width: 100%; justify-content: center; }
  #hc-modal-footer-left { width: 100%; text-align: center; margin-right: 0; }
  #hc-badge { bottom: 12px; right: 12px; }
  #hc-badge-tooltip { display: none; }
}
@media (max-width: 480px) {
  #hc-banner-actions { grid-template-columns: 1fr; }
  #hc-modal { max-height: 95vh; }
}

/* ============================================================
   RESPONSIVE TABLE COOKIES AÑADIDAS DENIS
   ============================================================ */
@media (max-width: 768px) {
  .cp-table-wrap table {
    width: 100%;
    border-collapse: collapse;
  }

  .cp-table-wrap thead {
    display: none; /* oculta la cabecera original */
  }

  .cp-table-wrap tr {
    display: block;
    margin-bottom: 1.2em;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    background: #fafafa;
  }

  .cp-table-wrap td {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
  }

  .cp-table-wrap td:last-child {
    border-bottom: none;
  }

  /* Añade la etiqueta del encabezado antes de cada celda */
  .cp-table-wrap td::before {
    content: attr(data-label);
    display: block;
    font-weight: bold;
    font-size: 0.78em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 2px;
  }
}
@media (max-width: 768px) {
  .cp-table-wrap table {
    min-width: unset !important;
    width: 100%;
  }
}