/* Cookie Consent Banner Styles */

/* Google Maps Placeholder */
.cookie-map-placeholder {
    position: relative;
    min-height: 450px;
    background: var(--element-background);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.map-consent-message {
    text-align: center;
    padding: 40px 20px;
}

.map-consent-message p {
    font-size: 16px;
    color: var(--light-text-color);
    margin-bottom: 20px;
}

.map-consent-message .cookie-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  background: var(--contact-bg);
  color: var(--contact-color);
}

.map-consent-message .cookie-btn:hover {
    text-decoration: underline;
}

/* Cookie Banner */
#cookie-consent-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--header-bg);
  color: #fff;
  border-radius: 5px;
  padding: 16px 20px 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
  z-index: 999999;
  display: none;
  max-width: 435px;
}

#cookie-consent-banner p, #cookie-modal-heading, #cookie-consent-banner span, .cookie-modal-content > p, .cookie-category p {
  color: var(--title-color);
}

#cookie-consent-banner.show {
    display: block;
}

.cookie-banner-content {
  margin: 0 auto;
  display: flex;
  align-items: last baseline;
  justify-content: left;
  gap: 20px;
  flex-wrap: wrap;
  flex-direction: column;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text span {
  margin: 0 0 8px 0;
  font-size: 19px;
  color: #fff;
  font-weight: 600;
}
.cookie-banner-text span {
  display: flex;
  gap: 8px;
}
.cookie-banner-text span img {
  transform: translateY(2px);
}
.cookie-banner-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    color: #fff;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
}

/* Cookie Buttons */
.cookie-btn {
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-wrap: nowrap;
    padding: 10px;
}
.cookie-btn-save {
  background: var(--element-background);
  color: var(--title-color);
}
.cookie-btn-save:hover {
  text-decoration: underline;
}

.cookie-btn-accept {
  background: var(--reservation);
  color: var(--reservation-color);
}
.cookie-btn-deny {
  background: var(--element-background);
  color: var(--title-color);
}
.cookie-btn-deny:hover,
.cookie-btn-accept:hover {
    text-decoration: underline;
}
.cookie-btn-deny, .cookie-btn-accept, .cookie-btn-save {
  border: 2px solid #161616 !important;
}

/* Settings Modal */
#cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999999;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-content {
    background: var(--services-nav);
    color: var(--title-color);
    padding: 0 32px 32px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    margin: 20px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#cookie-settings-modal.show .cookie-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.cookie-header {
  position: sticky;
  top: 0;
  padding: 20px 0;
  z-index: 2;
  background: var(--services-nav);
}
/* Close Button (X) */
.cookie-modal-close {
  position: absolute;
  top: 24px;
  right: -8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  z-index: 1;
}
.cookie-modal-close:hover {
    background-color: #f0f0f0;
}

.cookie-modal-close svg {
    width: 24px;
    height: 24px;
    fill: #666;
    transition: fill 0.2s ease;
}

.cookie-modal-close:hover svg {
    fill: #333;
}

#cookie-modal-heading {
  margin: 0;
  font-size: 24px;
  font-weight: 600 !important;
  color: var(--title-color);
  display: flex;
  gap: 14px;
  align-items: center;
}
#cookie-modal-heading img {
  width: 22px;
  height: 22px;
}
.cookie-modal-content > p {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--light-text-color);
    line-height: 1.6;
}

/* Cookie Categories */
.cookie-category {
    padding: 0;
    margin: 12px 0;
    background: var(--element-background);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    user-select: none;
    transition: background-color 0.2s ease;
}
.cookie-category-title {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  border: unset;
  background-color: transparent;
  cursor: pointer;
}

.cookie-category span {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    color: var(--title-color);
}
.cookie-category span:hover {
  text-decoration: underline;
}

.cookie-category p {
    margin: 0;
    padding: 0 20px 18px 20px;
    font-size: 14px;
    color: var(--light-text-color);
    line-height: 1.5;
}

/* Services List */
.cookie-services {
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--element-background);
}

.cookie-services.expanded {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

.cookie-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.cookie-service-item:first-child {
  border-top: 1px solid var(--border-color);
}

.cookie-service-item:last-child {
    border-bottom: none;
}

.cookie-service-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--title-color);
}

/* Expand Arrow */
.category-expand-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.category-expand-arrow svg {
    width: 16px;
    height: 16px;
    fill: var(--title-color);
    transition: fill 0.2s ease;
}

.category-expand-arrow:hover svg {
    fill: #333;
}

.category-expand-arrow.expanded {
    transform: rotate(180deg);
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    z-index: 1;
}

/* Pienemmät togglet palveluille */
.cookie-service-item .cookie-toggle {
    width: 40px;
    height: 20px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.cookie-service-item .cookie-toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #41474d;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(26px);
}

.cookie-service-item .cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
}

/* Modal Buttons */
.cookie-modal-buttons {
    margin-top: 32px;
    display: flex;
    gap: 10px;
  justify-content: flex-end;
  flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cookie-banner-buttons {
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
    }
}

@media (max-width: 580px) {
#cookie-modal-heading {
  font-size: 1rem !important;
}
.cookie-modal-close {
  top: 14px;
}
.cookie-modal-buttons {
  flex-direction: column-reverse;
}
#cookie-consent-banner {
  max-width: unset;
  width: calc(100% - 40px);
}
.cookie-banner-buttons {
  flex-direction: column-reverse;
}
}