/* When variation is pre-selected from URL (boat booking), hide "unavailable" message */
body.boat-booking-variation-from-url .woocommerce-variation-unavailable,
body.boat-booking-variation-from-url .single_variation_wrap .woocommerce-variation-unavailable{
  display:none !important;
}

.boat-calendar{
  max-width:1400px;
  margin:80px auto;
  font-family:Arial;
  padding:20px;
}

.calendar-title{
  text-align:center;
  font-size:32px;
  margin-bottom:30px;
  color:#333;
}

.calendar-nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:30px;
  padding:0 20px;
  gap:12px;
}

.nav-btn{
  padding:10px 20px;
  background:#0073aa;
  color:#fff;
  text-decoration:none;
  border-radius:5px;
  transition:background 0.3s;
  font-size:14px;
  line-height:1;
  white-space:nowrap;
}

.nav-btn:hover{
  background:#005a87;
  color:#fff;
}

.current-month{
  font-size:20px;
  font-weight:600;
  color:#333;
}

.nav-center{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  flex:1;
}

.calendar-jump{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
}

.calendar-jump select{
  padding:8px 10px;
  border:1px solid #ccc;
  border-radius:6px;
  background:#fff;
  font-size:14px;
  max-width:160px;
}

.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:10px;
}

.calendar-cell{
  border:2px solid #ddd;
  min-height:180px;
  position:relative;
  padding:12px;
  background:#fff;
  border-radius:8px;
  transition:transform 0.2s, box-shadow 0.2s;
}

.calendar-cell:hover{
  transform:translateY(-2px);
  box-shadow:0 4px 8px rgba(0,0,0,0.1);
}

.calendar-cell.past{
  background:#f3f3f3;
  border-color:#e0e0e0;
}

.calendar-cell.past:hover{
  transform:none;
  box-shadow:none;
}

.calendar-cell.past .date-num{
  color:#9a9a9a;
}

.calendar-cell.past .calendar-img,
.calendar-img.calendar-img-disabled{
  filter:grayscale(1);
  opacity:0.55;
  cursor:not-allowed;
}

.calendar-cell.past .calendar-img:hover{
  opacity:0.55;
}

.date-num{
  font-size:28px;
  font-weight:600;
  color:#333;
  display:block;
  margin-bottom:10px;
}

.calendar-img{
  height:120px;
  width:100%;
  background-size:cover;
  background-position:center;
  border-radius:5px;
  cursor:pointer;
  transition:opacity 0.3s;
}

.calendar-img:hover{
  opacity:0.8;
}

.calendar-text{
  display:none;
}

/* Boat SVG Wrapper */
.boat-map-wrapper{
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.9);
  z-index:9998;
  overflow:auto;
  padding:40px 20px;
}

.boat-map-wrapper.active{
  display:block;
}

.boat-map-close{
  position:absolute;
  top:20px;
  right:30px;
  font-size:50px;
  color:#fff;
  cursor:pointer;
  z-index:9999;
  width:50px;
  height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,0.2);
  border-radius:50%;
  transition:background 0.3s;
}

.boat-map-close:hover{
  background:rgba(255,255,255,0.4);
}

.boat-svg-container{
  max-width:90%;
  margin:0 auto;
  text-align:center;
  min-height:200px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.boat-image-loader{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:16px;
  padding:40px;
  color:rgba(255,255,255,0.9);
}
.boat-image-loader p{
  margin:0;
  font-size:16px;
}
.boat-loader-spinner{
  width:48px;
  height:48px;
  border:4px solid rgba(255,255,255,0.3);
  border-top-color:#fff;
  border-radius:50%;
  animation:boat-loader-spin 0.8s linear infinite;
}
@keyframes boat-loader-spin{
  to{ transform:rotate(360deg); }
}

.boat-svg-container svg{
  max-width:100%;
  height:auto;
  cursor:pointer;
}

.boat-svg-container svg path,
.boat-svg-container svg circle,
.boat-svg-container svg rect,
.boat-svg-container svg polygon{
  transition:fill 0.3s, stroke 0.3s;
}

.boat-svg-container svg path:hover,
.boat-svg-container svg circle:hover,
.boat-svg-container svg rect:hover,
.boat-svg-container svg polygon:hover{
  fill:#0073aa !important;
  stroke:#0073aa !important;
}

/* Package Popup */
.package-popup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.6);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:10000;
}

.package-popup.active{
  display:flex;
}

.package-popup-inner{
  background:#fff;
  width:500px;
  max-width:90%;
  padding:30px;
  position:relative;
  border-radius:10px;
  max-height:80vh;
  overflow-y:auto;
}

.package-popup-inner .popup-close{
  position:absolute;
  top:15px;
  right:20px;
  font-size:40px;
  cursor:pointer;
  color:#666;
  line-height:1;
  transition:color 0.3s;
}

.package-popup-inner .popup-close:hover{
  color:#000;
}

#package-popup-title{
  margin:0 0 20px 0;
  font-size:24px;
  color:#333;
}

.package-item{
  padding:15px;
  margin-bottom:15px;
  border:2px solid #ddd;
  border-radius:8px;
  cursor:pointer;
  transition:all 0.3s;
  background:#fff;
}

.package-item:hover{
  border-color:#0073aa;
  background:#f0f8ff;
  transform:translateX(5px);
}

.package-item.sold-out{
  opacity:0.5;
  cursor:not-allowed;
}

.package-item.sold-out:hover{
  transform:none;
  border-color:#ddd;
  background:#fff;
}

.package-name{
  font-size:18px;
  font-weight:600;
  color:#333;
  margin-bottom:8px;
}

.package-price{
  font-size:20px;
  color:#0073aa;
  font-weight:600;
  margin-bottom:5px;
}

.package-stock{
  font-size:14px;
  color:#666;
}

.package-stock.in-stock{
  color:#28a745;
}

.package-stock.out-of-stock{
  color:#dc3545;
}

/* Product Details Slide-in Popup */
.product-details-popup{
  position:fixed;
  top:0;
  right:-100%;
  width:500px;
  max-width:90%;
  height:100%;
  background:#fff;
  z-index:10001;
  box-shadow:-2px 0 10px rgba(0,0,0,0.3);
  transition:right 0.4s ease-in-out;
  overflow-y:auto;
}

.product-details-popup.active{
  right:0;
}

.product-details-inner{
  padding:30px;
  position:relative;
}

.popup-close-details{
  position:absolute;
  top:20px;
  right:20px;
  font-size:40px;
  cursor:pointer;
  color:#666;
  line-height:1;
  transition:color 0.3s;
  z-index:10;
}

.popup-close-details:hover{
  color:#000;
}

.product-details-image{
  width:100%;
  height:300px;
  object-fit:cover;
  border-radius:8px;
  margin-bottom:20px;
}

.product-details-title{
  font-size:28px;
  color:#333;
  margin-bottom:15px;
}

.product-details-price{
  font-size:24px;
  color:#0073aa;
  font-weight:600;
  margin-bottom:20px;
}

.product-details-description{
  color:#666;
  line-height:1.6;
  margin-bottom:20px;
}

.product-details-short{
  color:#333;
  font-size:16px;
  line-height:1.6;
  margin-bottom:20px;
}

.product-details-meta{
  margin:20px 0;
  padding:15px;
  background:#f9f9f9;
  border-radius:8px;
}

.product-meta-item{
  margin-bottom:10px;
  font-size:14px;
}

.product-meta-label{
  font-weight:600;
  color:#333;
  display:inline-block;
  width:120px;
}

.product-meta-value{
  color:#666;
}

.variation-attributes{
  margin:15px 0;
  padding:10px;
  background:#f0f8ff;
  border-radius:5px;
}

.variation-attribute{
  margin:5px 0;
  font-size:14px;
}

.view-product-btn{
  display:block;
  width:100%;
  padding:15px;
  background:#0073aa;
  color:#fff;
  text-align:center;
  text-decoration:none;
  border-radius:8px;
  font-size:18px;
  font-weight:600;
  margin-top:20px;
  transition:background 0.3s;
}

.view-product-btn:hover{
  background:#005a87;
  color:#fff;
}

/* Responsive */
@media (max-width:768px){
  .calendar-grid{
    grid-template-columns:repeat(3,1fr);
  }

  .calendar-nav{
    flex-direction:column;
    align-items:stretch;
    padding:0;
  }

  .nav-btn{
    width:100%;
    text-align:center;
    padding:12px 14px;
    font-size:14px;
  }

  .current-month{
    text-align:center;
    font-size:18px;
  }

  .calendar-jump{
    width:100%;
  }

  .calendar-jump select{
    flex:1;
    min-width:140px;
    max-width:none;
  }
  
  .product-details-popup{
    width:100%;
    max-width:100%;
  }
  
  .package-popup-inner{
    width:95%;
  }
}

@media (max-width:480px){
  .calendar-grid{
    grid-template-columns:repeat(2,1fr);
  }

  .calendar-jump select{
    min-width:120px;
    font-size:13px;
    padding:8px;
  }
  
  .calendar-cell{
    min-height:150px;
  }
  
  .calendar-img{
    height:100px;
  }
}
