/* ============================================================
   PS Cookie Consent — Stylesheet v1.1
   Posición flotante izquierda | Mobile bottom-sheet responsive
   primestudio.cl brand system
   ============================================================ */

:root {
  --ps-cc-white:      #ffffff;
  --ps-cc-accent:     #ff3c00;
  --ps-cc-accent2:    #ff6a35;
  --ps-cc-surface:    #141414;
  --ps-cc-border:     rgba(255,255,255,0.08);
  --ps-cc-text:       #e8e8e8;
  --ps-cc-muted:      #888888;
  --ps-cc-toggle-on:  #ff3c00;
  --ps-cc-toggle-off: #3a3a3a;
  --ps-cc-radius:     16px;
  --ps-cc-shadow:     0 32px 80px rgba(0,0,0,0.75), 0 4px 24px rgba(255,60,0,0.1);
  --ps-cc-font:       'Inter', 'Helvetica Neue', Arial, sans-serif;
  --ps-cc-z:          999999;
  --ps-cc-width:      380px;
  --ps-cc-gap:        24px;
}

/* ── OVERLAY ── */
#ps-cc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: calc(var(--ps-cc-z) - 1);
  animation: ps-cc-fade-in 0.3s ease;
}
#ps-cc-overlay.ps-cc-visible { display: block; }

/* ── BANNER — flotante izquierda (desktop) ── */
#ps-cc-banner {
  position: fixed;
  left: var(--ps-cc-gap);
  bottom: var(--ps-cc-gap);
  width: var(--ps-cc-width);
  max-width: calc(100vw - calc(var(--ps-cc-gap) * 2));
  max-height: calc(100vh - 48px);
  z-index: var(--ps-cc-z);
  font-family: var(--ps-cc-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ps-cc-text);
  background: var(--ps-cc-surface);
  border: 1px solid var(--ps-cc-border);
  border-radius: var(--ps-cc-radius);
  box-shadow: var(--ps-cc-shadow);
  overflow-y: auto;
  overflow-x: hidden;
  /* entrada desde la izquierda */
  transform: translateX(calc(-100% - var(--ps-cc-gap) - 20px));
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34,1.2,0.64,1), opacity 0.4s ease;
}
#ps-cc-banner::-webkit-scrollbar { width: 3px; }
#ps-cc-banner::-webkit-scrollbar-track { background: transparent; }
#ps-cc-banner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

#ps-cc-banner.ps-cc-visible   { transform: translateX(0); opacity: 1; }
#ps-cc-banner.ps-cc-hiding    { transform: translateX(calc(-100% - var(--ps-cc-gap) - 20px)) !important; opacity: 0 !important; }

/* Accent bar vertical izquierda */
#ps-cc-banner::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--ps-cc-accent) 0%, var(--ps-cc-accent2) 60%, transparent 100%);
  border-radius: var(--ps-cc-radius) 0 0 var(--ps-cc-radius);
  pointer-events: none;
}

/* ── INNER ── */
.ps-cc-inner { padding: 22px 22px 18px 26px; }

/* ── HEADER ── */
.ps-cc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ps-cc-icon {
  font-size: 20px; flex-shrink: 0;
  animation: ps-cc-wiggle 3s ease infinite;
}
@keyframes ps-cc-wiggle {
  0%,80%,100% { transform: rotate(0deg); }
  85%          { transform: rotate(-12deg); }
  92%          { transform: rotate(10deg); }
}
.ps-cc-title { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: var(--ps-cc-white); margin: 0; flex: 1; }

/* ── BODY TEXT ── */
.ps-cc-body { color: var(--ps-cc-muted); font-size: 12.5px; margin-bottom: 18px; line-height: 1.6; }
.ps-cc-body a { color: var(--ps-cc-accent2); text-decoration: none; border-bottom: 1px solid rgba(255,106,53,0.3); transition: border-color 0.2s; }
.ps-cc-body a:hover { border-color: var(--ps-cc-accent2); }

/* ── CATEGORIES ── */
.ps-cc-categories { display: none; margin-bottom: 18px; border: 1px solid var(--ps-cc-border); border-radius: 10px; overflow: hidden; }
.ps-cc-categories.ps-cc-open { display: block; }
.ps-cc-category { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--ps-cc-border); transition: background 0.2s; }
.ps-cc-category:last-child { border-bottom: none; }
.ps-cc-category:hover { background: rgba(255,255,255,0.025); }
.ps-cc-cat-info { flex: 1; min-width: 0; }
.ps-cc-cat-name { font-weight: 600; font-size: 12px; color: var(--ps-cc-white); display: flex; align-items: center; gap: 5px; margin-bottom: 3px; flex-wrap: wrap; }
.ps-cc-badge { font-size: 10px; font-weight: 500; padding: 1px 6px; border-radius: 20px; background: rgba(255,255,255,0.07); color: var(--ps-cc-muted); white-space: nowrap; }
.ps-cc-cat-desc { font-size: 11.5px; color: var(--ps-cc-muted); line-height: 1.45; }

/* ── TOGGLE ── */
.ps-cc-toggle-wrap { flex-shrink: 0; padding-top: 2px; }
.ps-cc-toggle { position: relative; width: 40px; height: 22px; display: inline-block; cursor: pointer; }
.ps-cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ps-cc-toggle-slider { position: absolute; inset: 0; border-radius: 22px; background: var(--ps-cc-toggle-off); transition: background 0.3s; }
.ps-cc-toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform 0.3s cubic-bezier(0.34,1.5,0.64,1); box-shadow: 0 1px 5px rgba(0,0,0,0.45); }
.ps-cc-toggle input:checked + .ps-cc-toggle-slider { background: var(--ps-cc-toggle-on); }
.ps-cc-toggle input:checked + .ps-cc-toggle-slider::before { transform: translateX(18px); }
.ps-cc-toggle input:disabled + .ps-cc-toggle-slider { opacity: 0.35; cursor: not-allowed; }

/* ── BUTTONS ── */
.ps-cc-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ps-cc-btn-customize { grid-column: 1 / -1; }
.ps-cc-btn {
  padding: 10px 14px; border-radius: 8px; border: none;
  font-family: var(--ps-cc-font); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; position: relative; overflow: hidden; white-space: nowrap;
}
.ps-cc-btn::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0); transition: background 0.2s; }
.ps-cc-btn:hover::after { background: rgba(255,255,255,0.07); }
.ps-cc-btn:active { transform: scale(0.97); }
.ps-cc-btn-accept { background: var(--ps-cc-accent); color: #fff; }
.ps-cc-btn-accept:hover { background: #e63600; }
.ps-cc-btn-reject { background: transparent; color: var(--ps-cc-muted); border: 1px solid rgba(255,255,255,0.1); }
.ps-cc-btn-reject:hover { color: var(--ps-cc-white); border-color: rgba(255,255,255,0.22); }
.ps-cc-btn-customize { background: transparent; color: var(--ps-cc-accent2); border: 1px solid rgba(255,106,53,0.2); font-size: 12px; }
.ps-cc-btn-customize:hover { border-color: rgba(255,106,53,0.55); }
.ps-cc-btn-save { background: var(--ps-cc-accent); color: #fff; width: 100%; display: block; }
.ps-cc-btn-save:hover { background: #e63600; }
#ps-cc-save-wrap { display: none; margin-top: 8px; }

/* ── FOOTER ── */
.ps-cc-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ps-cc-border); font-size: 11px; color: var(--ps-cc-muted); }
.ps-cc-footer-links { display: none; }
.ps-cc-brand { color: rgba(255,255,255,0.18); font-size: 10px; letter-spacing: 0.4px; text-transform: uppercase; }

@keyframes ps-cc-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── BOTÓN RE-ABRIR ── */
#ps-cc-reopen {
  position: fixed; bottom: 20px; left: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ps-cc-surface); border: 1px solid var(--ps-cc-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.55);
  font-size: 20px; display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: calc(var(--ps-cc-z) - 2); color: #fff; text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
}
#ps-cc-reopen:hover { transform: scale(1.12); box-shadow: 0 6px 28px rgba(255,60,0,0.4); }
#ps-cc-reopen.ps-cc-visible { display: flex; }

/* ═══════════════════════════════════════════
   MOBILE (≤ 540px) — Bottom Sheet
═══════════════════════════════════════════ */
@media (max-width: 540px) {
  #ps-cc-banner {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none;
    /* mobile: entra desde abajo */
    transform: translateY(calc(100% + 20px)) !important;
    opacity: 1 !important;
    transition: transform 0.45s cubic-bezier(0.34,1.2,0.64,1) !important;
  }
  #ps-cc-banner.ps-cc-visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }
  #ps-cc-banner.ps-cc-hiding {
    transform: translateY(calc(100% + 20px)) !important;
    opacity: 1 !important;
  }
  /* Accent bar horizontal arriba en mobile */
  #ps-cc-banner::before {
    left: 0; right: 0; top: 0; bottom: auto;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--ps-cc-accent), var(--ps-cc-accent2), transparent);
    border-radius: 20px 20px 0 0;
  }
  /* Drag handle */
  #ps-cc-banner::after {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.14);
    border-radius: 2px;
    margin: 10px auto -2px;
  }
  .ps-cc-inner { padding: 12px 20px 28px 20px; }
  .ps-cc-btn { padding: 13px 10px; font-size: 13px; }
  .ps-cc-category { padding: 13px 14px; }
  #ps-cc-reopen { bottom: 16px; left: 16px; }
}

/* ── TABLET (541–768px): panel un poco más estrecho ── */
@media (min-width: 541px) and (max-width: 768px) {
  :root { --ps-cc-width: 340px; --ps-cc-gap: 16px; }
}
