﻿/**
 * Cookie Consent Banner Styles
 * GDPR & Italian Garante Compliant
 * Bella Italia Gateway
 */

/* Banner Container - Fixed positioning to avoid CLS */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(26, 24, 22, 0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-banner.show {
  transform: translateY(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner {
    transition: none;
  }
}

/* Banner Content */
.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 5%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  position: relative;
}

/* Close Button (X = Reject All per Garante) */
.cookie-banner-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(212, 175, 55, 0.1);
  color: #d4af37;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.cookie-banner-close:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: rotate(90deg);
}

/* Banner Text */
.cookie-banner-text {
  color: #f5f3ed;
}

.cookie-banner-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: #d4af37;
  margin-bottom: 0.5rem;
}

.cookie-banner-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #b8b5ad;
  margin: 0;
}

.cookie-banner-desc a {
  color: #d4af37;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.cookie-banner-desc a:hover {
  color: #e5c158;
}

/* Banner Actions - Equal weight buttons per Garante */
.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 12px 24px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: #8b1538;
  color: #fff;
}

.cookie-btn-primary:hover {
  background: #a91d47;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.4);
}

.cookie-btn-secondary {
  background: #2a2624;
  color: #f5f3ed;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.cookie-btn-secondary:hover {
  background: #3a3634;
  border-color: #d4af37;
}

.cookie-btn-outline {
  background: transparent;
  color: #d4af37;
  border: 1px solid #d4af37;
}

.cookie-btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: #e5c158;
  color: #e5c158;
}

/* Customize Panel */
.cookie-customize-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 5%;
}

.cookie-customize-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: #d4af37;
  margin-bottom: 0.5rem;
}

.cookie-customize-desc {
  font-size: 0.9rem;
  color: #b8b5ad;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Cookie Categories */
.cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cookie-category {
  background: rgba(42, 38, 36, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 4px;
  padding: 1.5rem;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.cookie-category-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cookie-category-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #f5f3ed;
  margin: 0;
}

.cookie-category-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #d4af37;
  background: rgba(212, 175, 55, 0.1);
  padding: 4px 8px;
  border-radius: 3px;
}

.cookie-category-desc {
  font-size: 0.85rem;
  color: #b8b5ad;
  line-height: 1.6;
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

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

.cookie-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2a2624;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 26px;
  transition: all 0.3s ease;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #b8b5ad;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: #8b1538;
  border-color: #8b1538;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(24px);
  background: #fff;
}

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

/* Customize Actions */
.cookie-customize-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Floating Preferences Button */
.cookie-preferences-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #8b1538;
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  transition: all 0.3s ease;
}

.cookie-preferences-btn:hover {
  background: #a91d47;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 21, 56, 0.4);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .cookie-banner-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .cookie-banner-actions {
    justify-content: stretch;
  }

  .cookie-btn {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .cookie-banner-content,
  .cookie-customize-panel {
    padding: 1.5rem 1rem;
  }

  .cookie-banner-title {
    font-size: 1.3rem;
  }

  .cookie-banner-desc {
    font-size: 0.85rem;
  }

  .cookie-banner-actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }

  .cookie-category {
    padding: 1rem;
  }

  .cookie-preferences-btn {
    width: 45px;
    height: 45px;
    bottom: 15px;
    left: 15px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .cookie-banner-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .cookie-customize-title {
    font-size: 1.5rem;
  }
}

/* Focus styles for accessibility */
.cookie-btn:focus,
.cookie-banner-close:focus,
.cookie-toggle input:focus + .cookie-toggle-slider,
.cookie-preferences-btn:focus {
  outline: 2px solid #d4af37;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cookie-banner {
    border-top-width: 2px;
  }

  .cookie-btn {
    border-width: 2px;
  }
}
