/* =========================================
   LAYOUT
========================================= */

.oco-wrapper {
  margin-top: 20px;
}

/* =========================================
   HEADER
========================================= */

.oco-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
}

.oco-header h2 {
  margin: 0;
}

.oco-count {
  margin-top: 6px;
  font-size: 14px;
  opacity: 0.65;
}

/* =========================================
   FILTER SECTION (MATCHING EVENTS)
======================================== */

.oco-filters-section {
  display: flex;
  gap: 32px;
  margin: 24px 0 40px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.oco-search-group {
  flex: 1;
  min-width: 280px;
}

.oco-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.oco-search-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  opacity: 0.5;
  pointer-events: none;
}

#oco-search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  font-size: 15px;
  color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

#oco-search-input:focus {
  outline: none;
  border-color: #b89a5b;
  box-shadow: 0 4px 15px rgba(184, 154, 91, 0.12);
}

.oco-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.oco-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin-left: 4px;
}

.oco-time-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.oco-filter {
  padding: 10px 22px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.oco-filter:hover {
  background: #fff;
  border-color: #b89a5b;
  color: #b89a5b;
  box-shadow: 0 4px 12px rgba(184, 154, 91, 0.15);
  transform: translateY(-1px);
}

.oco-filter.active {
  background: #b89a5b;
  border-color: #b89a5b;
  color: #fff;
  box-shadow: 0 6px 20px rgba(184, 154, 91, 0.25);
}

/* =========================================
   TOGGLE (Modernized)
========================================= */

.oco-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: #f8f8f8;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.oco-toggle:hover {
  border-color: #b89a5b;
}

.oco-toggle input {
  display: none;
}

.oco-slider {
  width: 40px;
  height: 22px;
  background: #ddd;
  border-radius: 999px;
  position: relative;
  transition: all 0.25s ease;
}

.oco-slider::after {
  content: "";
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.oco-toggle input:checked + .oco-slider {
  background: #b89a5b;
}

.oco-toggle input:checked + .oco-slider::after {
  transform: translateX(18px);
}

/* =========================================
   GRID & CONTENT LAYOUT
========================================= */

.oco-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  width: 100%;
}

.oco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  width: 100%;
}

/* =========================================
   CARD (Matching Events Design)
========================================= */

.oco-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e9e9e9;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.oco-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.oco-card-image {
  position: absolute;
  inset: 0;
}

.oco-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s ease;
}

.oco-card:hover .oco-card-image img {
  transform: scale(1.05);
}

.oco-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.45) 35%, rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0) 100%);
}

.oco-card-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

/* =========================================
   BADGES & CHIPS
========================================= */

.oco-card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.oco-chip {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
}

.oco-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  color: #fff;
  background: rgba(var(--badge-color), 0.7);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.oco-badge--open { --badge-color: 46, 125, 50; }
.oco-badge--season { --badge-color: 184, 154, 91; }
.oco-badge--event { 
  --badge-color: 67, 97, 238; 
  background: linear-gradient(135deg, rgba(67, 97, 238, 0.9), rgba(114, 9, 183, 0.9));
  animation: shine 2s infinite linear;
  background-size: 200% auto;
}
.oco-badge--closed { --badge-color: 198, 62, 62; }
.oco-badge--booking { --badge-color: 120, 120, 120; }

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.oco-badge--booking::before {
  content: "🌐";
  margin-right: 6px;
}

/* =========================================
   MAP & RESPONSIVE
========================================= */

.oco-map {
  width: 100%;
  height: 60vh;
  min-height: 420px;
  border-radius: 18px;
}

@media (min-width: 1024px) {
  .oco-content-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 40px;
    align-items: start;
  }

  .oco-map-wrap {
    grid-column: 2;
    position: sticky;
    top: 24px;
    z-index: 10;
  }

  .oco-map {
    height: 75vh;
  }
}

@media (max-width: 1024px) {
  .oco-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .oco-filters-section {
    gap: 20px;
    flex-direction: column;
    align-items: stretch;
    margin: 16px 0 32px;
  }

  .oco-time-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px; /* Room for scroll/breathing room */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px; /* Consistency with new map margin */
    padding-left: 12px;
    padding-right: 12px;
  }

  .oco-time-filters::-webkit-scrollbar {
    display: none;
  }

  .oco-filter {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 13px;
  }

  .oco-filter-group {
    gap: 6px;
  }

  /* 📱 MOBILE CAROUSEL LAYOUT */
  .oco-content-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin: 0;
  }

  .oco-map-wrap {
    order: 1;
    padding: 0 12px; /* Add back some margin */
    margin-bottom: 24px;
  }

  .oco-map {
    height: 40vh;
    min-height: 350px;
    border-radius: 12px; /* Rounded corners back */
  }

  .oco-grid {
    order: 2;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 0 12px 30px; /* Align with carousels horizontal margin */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
  }

  .oco-grid::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
  }

  .oco-card {
    flex: 0 0 280px;
    scroll-snap-align: center;
    aspect-ratio: 4 / 3.5;
  }

  .oco-card-name {
    font-size: 1.1rem;
  }

  /* 📱 MOBILE POPUP REFINEMENTS */
  .oco-popup {
    min-width: 200px;
  }

  .oco-popup-title {
    font-size: 15px !important;
  }

  .oco-popup-status {
    font-size: 13px !important;
    margin-bottom: 8px !important;
  }

  .oco-popup-actions {
    gap: 6px !important;
  }

  .oco-popup-btn {
    padding: 7px 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
  }
}

/* =========================================
   POPUP
========================================= */

.oco-leaflet-popup .leaflet-popup-content-wrapper {
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.oco-popup {
  font-family: inherit;
  min-width: 240px;
}

.oco-popup-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.oco-popup-status {
  margin-bottom: 16px;
  font-size: 15px;
}

.oco-popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.oco-popup-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #f2f2f2;
  color: #111;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.oco-popup-btn--primary {
  background: #111 !important;
  color: #fff !important;
}

.oco-popup-icon {
  font-size: 18px;
}

/* =========================================
   SKELETON LOADING
========================================= */

.oco-skeleton-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  background: #eee;
  overflow: hidden;
}

.oco-skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 1024px) {
  .oco-skeleton-card {
    flex: 0 0 280px;
    aspect-ratio: 4 / 3.5;
  }
}

/* =========================================
   OPENING HOURS BOX
========================================= */

.oco-hours-box {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.oco-card:hover .oco-hours-box {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.oco-hours-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.oco-hours-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.oco-hour-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.oco-hour-row.is-today {
  color: #fff;
  font-weight: 700;
}

.oco-day-name {
  opacity: 0.7;
  min-width: 60px;
}

.oco-day-time {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Anpassning för att kortet ska kunna växa om det behövs */
.oco-card {
  height: auto;
  aspect-ratio: auto;
  min-height: 280px;
}

