/* =============================================
   CIAO MARKET — Cookie Consent Banner
   ============================================= */

/* ── Banner ── */
#cc-banner {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  z-index: 9999;
  width: calc(100% - 2rem);
  max-width: 860px;
  background: #ffffff;
  border: 1.5px solid rgba(215,128,244,0.22);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(85,130,157,0.18);
  padding: 1.75rem 2rem;
  font-family: 'Poppins', sans-serif;
  transition: transform 0.5s cubic-bezier(0.34,1.4,0.64,1);
}
#cc-banner.cc-visible {
  transform: translateX(-50%) translateY(0);
}

.cc-banner-inner {
  display: flex; gap: 2rem; align-items: center;
}
.cc-banner-text { flex: 1; min-width: 0; }
.cc-banner-title {
  font-size: 0.95rem; font-weight: 600;
  color: #55829d; margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}
.cc-banner-desc {
  font-size: 0.8rem; font-weight: 300;
  color: #55829d; line-height: 1.7; opacity: 0.82;
}
.cc-banner-desc a {
  color: #d780f4; font-weight: 400;
  text-decoration: underline; text-underline-offset: 2px;
  white-space: nowrap;
}
.cc-banner-desc a:hover { opacity: 0.75; }
.cc-banner-actions {
  display: flex; gap: 0.6rem; flex-shrink: 0;
  align-items: center; flex-wrap: wrap;
}

/* ── Shared button styles ── */
.cc-btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 400; font-size: 0.76rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.65rem 1.35rem; border-radius: 100px;
  cursor: pointer; white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, transform 0.2s ease;
  border: none;
}
.cc-btn:hover { transform: translateY(-2px); }
.cc-btn:active { transform: none; }

.cc-btn-primary {
  background: #d780f4; color: #ffffff;
  border: 1.5px solid #d780f4;
}
.cc-btn-primary:hover { background: #55829d; border-color: #55829d; }

.cc-btn-outline {
  background: transparent; color: #55829d;
  border: 1.5px solid #55829d;
}
.cc-btn-outline:hover { background: #55829d; color: #ffffff; }

.cc-btn-ghost {
  background: transparent; color: #d780f4;
  border: 1.5px solid #d780f4;
}
.cc-btn-ghost:hover { background: #d780f4; color: #ffffff; }

/* ── Modal ── */
#cc-modal {
  display: none;
  position: fixed; inset: 0; z-index: 10000;
  align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif;
}
#cc-modal.cc-modal-visible { display: flex; }

.cc-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(85,130,157,0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cc-modal-card {
  position: relative; z-index: 1;
  background: #ffffff;
  border-radius: 20px;
  max-width: 540px; width: calc(100% - 2rem);
  padding: 2.25rem 2.25rem 1.75rem;
  box-shadow: 0 24px 80px rgba(85,130,157,0.2);
  max-height: 90svh; overflow-y: auto;
}
.cc-modal-card::-webkit-scrollbar { width: 4px; }
.cc-modal-card::-webkit-scrollbar-track { background: transparent; }
.cc-modal-card::-webkit-scrollbar-thumb { background: rgba(215,128,244,0.3); border-radius: 100px; }

.cc-modal-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: none; border: none;
  font-size: 0.9rem; cursor: pointer;
  color: #55829d; opacity: 0.45;
  width: 32px; height: 32px;
  border-radius: 100px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s, background 0.2s;
  font-family: 'Poppins', sans-serif;
}
.cc-modal-close:hover {
  opacity: 1;
  background: rgba(85,130,157,0.08);
}

.cc-modal-title {
  font-size: 1.25rem; font-weight: 600;
  color: #55829d; margin-bottom: 0.5rem;
  letter-spacing: -0.02em; line-height: 1.2;
  padding-right: 2rem;
}
.cc-modal-desc {
  font-size: 0.81rem; font-weight: 300;
  color: #55829d; opacity: 0.72;
  line-height: 1.72; margin-bottom: 1.75rem;
}

/* ── Cookie categories ── */
.cc-category {
  border-top: 1px solid rgba(85,130,157,0.1);
  padding: 1.1rem 0;
}
.cc-category:last-of-type {
  border-bottom: 1px solid rgba(85,130,157,0.1);
}
.cc-category-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 1.25rem;
}
.cc-category-info { flex: 1; min-width: 0; }
.cc-category-name {
  display: block;
  font-size: 0.9rem; font-weight: 400;
  color: #55829d; margin-bottom: 0.25rem;
}
.cc-category-desc {
  display: block;
  font-size: 0.77rem; font-weight: 300;
  color: #55829d; opacity: 0.62; line-height: 1.65;
}

/* Always-active label */
.cc-always-on {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #55829d; opacity: 0.5;
  padding: 0.28rem 0.85rem;
  border: 1.5px solid rgba(85,130,157,0.25);
  border-radius: 100px;
  white-space: nowrap; flex-shrink: 0;
  margin-top: 2px;
}

/* ── Toggle switch ── */
.cc-toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px; height: 26px;
  flex-shrink: 0; cursor: pointer;
  margin-top: 2px;
}
.cc-toggle-switch input {
  opacity: 0; width: 0; height: 0; position: absolute;
}
.cc-slider {
  position: absolute; inset: 0;
  background: rgba(85,130,157,0.18);
  border-radius: 100px;
  transition: background 0.3s;
}
.cc-slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 5px rgba(0,0,0,0.18);
}
.cc-toggle-switch input:checked + .cc-slider {
  background: #d780f4;
}
.cc-toggle-switch input:checked + .cc-slider::before {
  transform: translateX(20px);
}
.cc-toggle-switch input:focus-visible + .cc-slider {
  outline: 2px solid #d780f4;
  outline-offset: 2px;
}

/* ── Modal actions ── */
.cc-modal-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end;
  margin-top: 1.75rem; flex-wrap: wrap;
}
.cc-modal-links {
  display: flex; gap: 0.6rem;
  align-items: center; justify-content: center;
  margin-top: 1rem;
  font-size: 0.74rem; font-weight: 300;
  color: #55829d; opacity: 0.55;
}
.cc-modal-links a {
  color: #d780f4; opacity: 1;
  text-decoration: underline; text-underline-offset: 2px;
  font-weight: 400;
}
.cc-modal-links a:hover { opacity: 0.75; }

/* ── Floating "manage" button (post-consent) ── */
#cc-manage-btn {
  position: fixed; bottom: 1.5rem; left: 1.5rem;
  z-index: 9998;
  display: none;
  background: #ffffff;
  border: 1.5px solid rgba(215,128,244,0.3);
  border-radius: 100px;
  padding: 0.48rem 1rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.68rem; font-weight: 400;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: #55829d; cursor: pointer;
  box-shadow: 0 4px 18px rgba(85,130,157,0.1);
  transition: all 0.25s ease;
}
#cc-manage-btn.cc-manage-visible { display: block; }
#cc-manage-btn:hover {
  background: #f1eabe;
  border-color: #d780f4; color: #d780f4;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  #cc-banner {
    bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    transform: translateY(calc(100% + 1px));
    border-radius: 20px 20px 0 0;
  }
  #cc-banner.cc-visible { transform: translateY(0); }
  .cc-banner-inner { flex-direction: column; gap: 1.25rem; }
  .cc-banner-actions { width: 100%; justify-content: stretch; }
  .cc-banner-actions .cc-btn {
    flex: 1; text-align: center;
    display: flex; align-items: center; justify-content: center;
  }
  .cc-modal-card { padding: 1.75rem 1.35rem 1.5rem; border-radius: 20px 20px 0 0; align-self: flex-end; }
  #cc-modal { align-items: flex-end; }
  .cc-modal-actions { flex-direction: column; }
  .cc-modal-actions .cc-btn { width: 100%; justify-content: center; }
  #cc-manage-btn { bottom: 1rem; left: 1rem; }
}
