/* Cookie Consent Bar */
.cob-cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 2px solid rgba(236, 60, 67, 0.3);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  direction: rtl;
  font-family: "Tajawal", sans-serif;
  animation: slideUp 0.4s ease-out;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Cookie bar animation when footer is visible */
.cob-cookie-bar.footer-visible {
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  border-top-color: rgba(236, 60, 67, 0.5);
  box-shadow: 0 -8px 32px rgba(236, 60, 67, 0.2);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-bar-container {
  padding: 12px 0;
  max-width: 1170px;
  margin: 0 auto;
  width: 90%;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Cookie Bar Content */
.cookie-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex: 1;
}

/* Close Button */
.cookie-close-btn {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  transition: all 0.3s ease;
  border-radius: 50%;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.cookie-close-btn:hover {
  background: #f0f0f0;
  color: #ec3c43;
  transform: rotate(90deg);
}

.cookie-bar-text {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.cookie-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.cookie-bar-text p {
  margin: 0;
  color: #333;
  font-size: 0.85rem;
  line-height: 1.5;
}

.cookie-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.cob-cookie-bar .btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Tajawal", sans-serif;
  white-space: nowrap;
  display: inline-block;
  opacity: 1;
  visibility: visible;
}

.cob-cookie-bar .btn-accept {
  background: linear-gradient(135deg, #ec3c43 0%, #c41e24 100%);
  color: #fff;
  border: none;
}

.cob-cookie-bar .btn-accept:hover {
  background: linear-gradient(135deg, #c41e24 0%, #9a171c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(236, 60, 67, 0.3);
}

.cob-cookie-bar .btn-necessary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd !important;
}

.cob-cookie-bar .btn-necessary:hover {
  background: #e8e8e8;
  border-color: #ccc !important;
}

.cob-cookie-bar .btn-customize {
  background: transparent;
  color: #ec3c43;
  border: 2px solid #ec3c43 !important;
}

.cob-cookie-bar .btn-customize:hover {
  background: rgba(236, 60, 67, 0.1);
}

/* Settings Panel */
.cookie-settings-panel {
  display: none;
  background: rgba(248, 248, 248, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(224, 224, 224, 0.5);
  padding: 20px 0;
  margin: 0 -25px -20px;
  border-radius: 0 0 15px 15px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 300px;
    opacity: 1;
  }
}

.cookie-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
  padding: 0 25px;
}

.cookie-category-item {
  background: #fff;
  border-radius: 8px;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.cookie-category-item:hover {
  border-color: #ec3c43;
}

.cookie-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.cookie-checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s ease;
}

.cookie-checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: linear-gradient(135deg, #ec3c43 0%, #c41e24 100%);
  border-color: #ec3c43;
}

.cookie-checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.cookie-checkbox-label input[type="checkbox"]:disabled + .checkbox-custom {
  opacity: 0.6;
  cursor: not-allowed;
}

.category-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-text strong {
  font-size: 0.95rem;
  color: #333;
}

.category-text small {
  font-size: 0.75rem;
  color: #999;
}

.cookie-settings-actions {
  text-align: center;
  padding: 0 25px;
}

.btn-save {
  background: linear-gradient(135deg, #ec3c43 0%, #c41e24 100%);
  color: #fff;
  padding: 10px 40px;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Tajawal", sans-serif;
}

.btn-save:hover {
  background: linear-gradient(135deg, #c41e24 0%, #9a171c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(236, 60, 67, 0.3);
}

/* Mobile Responsive */
@media (max-width: 991px) {
  .cob-cookie-bar {
    max-width: 95%;
  }

  .cookie-bar-container {
    padding: 15px 20px;
  }

  .cookie-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cob-cookie-bar {
    bottom: 10px;
  }

  .cookie-bar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .cookie-bar-text {
    padding-left: 35px;
  }

  .cookie-close-btn {
    top: 20px;
    left: 10px;
    transform: translateY(0);
  }

  .cookie-bar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .cob-cookie-bar .btn {
    flex: 1;
    min-width: calc(50% - 5px);
  }

  .btn-accept {
    flex: 1 1 100%;
  }

  .cookie-categories-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .cookie-bar-container {
    padding: 12px 15px;
  }

  .cookie-bar-text p {
    font-size: 0.85rem;
  }

  .cookie-icon {
    font-size: 1.3rem;
  }

  .cob-cookie-bar .btn {
    font-size: 0.8rem;
    padding: 8px 12px;
  }
}

/* Accessibility */
.cob-cookie-bar:focus-within {
  outline: 3px solid #ec3c43;
  outline-offset: -3px;
}

.cob-cookie-bar .btn:focus {
  outline: 2px solid #ec3c43;
  outline-offset: 2px;
}

.cookie-close-btn:focus {
  outline: 2px solid #ec3c43;
  outline-offset: 2px;
}

/* Animation for closing */
.cookie-closing {
  animation: slideDownClose 0.4s ease-out forwards;
}

@keyframes slideDownClose {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, 150%);
    opacity: 0;
  }
}
