/* ===================================
   Casa Marina Vacanze - Mediterraneo Moderno
   =================================== */

/* --- CSS Custom Properties --- */
:root {
  --primary: #1B4965;
  --primary-light: #5FA8D3;
  --primary-dark: #0D2B3E;
  --accent: #E07A5F;
  --accent-hover: #C9644A;
  --accent-warm: #F2CC8F;
  --neutral-light: #F8F4F0;
  --neutral-dark: #2B2D42;
  --white: #FFFFFF;
  --success: #81B29A;
  --gray-100: #F7F7F7;
  --gray-200: #E5E5E5;
  --gray-500: #8D99AE;
  --shadow-sm: 0 2px 8px rgba(27, 73, 101, 0.08);
  --shadow-md: 0 4px 20px rgba(27, 73, 101, 0.12);
  --shadow-lg: 0 8px 40px rgba(27, 73, 101, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.3s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--neutral-dark);
  background-color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: "Playfair Display", serif;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

p {
  color: #4A4A5A;
  font-size: 1rem;
  line-height: 1.8;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Navbar --- */
.navbar-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  padding: 1rem 0;
  transition: var(--transition);
  background-color: transparent;
}

.navbar-main.scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 0;
}

.navbar-main .navbar-brand img {
  height: 40px;
  width: auto;
  transition: var(--transition);
}

.navbar-main .nav-link {
  color: var(--white);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  transition: var(--transition);
  position: relative;
}

.navbar-main.scrolled .nav-link {
  color: var(--primary);
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
  color: var(--accent-warm);
}

.navbar-main.scrolled .nav-link:hover,
.navbar-main.scrolled .nav-link.active {
  color: var(--accent);
}

.navbar-main .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background-color: var(--accent);
  border-radius: 1px;
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-main.scrolled .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(27,73,101,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.lang-switcher a {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

.lang-switcher a.active-lang {
  background-color: var(--accent);
  color: var(--white);
}

.lang-switcher a:not(.active-lang) {
  color: var(--white);
  opacity: 0.7;
}

.navbar-main.scrolled .lang-switcher a:not(.active-lang) {
  color: var(--primary);
  opacity: 0.7;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 43, 62, 0.4) 0%,
    rgba(27, 73, 101, 0.6) 50%,
    rgba(13, 43, 62, 0.85) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  padding: 2rem;
}

.hero-content h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-content .hero-logo {
  max-width: 500px;
  max-height: 400px;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.3rem);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-compact {
  min-height: 40vh;
  padding-top: 80px;
}

.hero-compact .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(13, 43, 62, 0.5) 0%,
    rgba(27, 73, 101, 0.75) 100%
  );
}

/* --- Buttons --- */
.btn-primary-custom {
  background-color: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.8rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary-custom:hover {
  background-color: var(--accent-hover);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(224, 122, 95, 0.4);
}

.btn-outline-custom {
  background-color: transparent;
  color: var(--white);
  border: 2px solid var(--white);
  padding: 0.8rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-outline-custom:hover {
  background-color: var(--white);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-whatsapp {
  background-color: #25D366;
  color: var(--white);
  border: none;
  padding: 0.8rem 2rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-whatsapp:hover {
  background-color: #1EBE5D;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

/* --- Sections --- */
.section {
  padding: 5rem 0;
}

.section-light {
  background-color: var(--neutral-light);
}

.section-white {
  background-color: var(--white);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  margin-bottom: 1rem;
}

.section-title p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--gray-500);
}

.section-title .title-divider {
  width: 60px;
  height: 3px;
  background-color: var(--accent);
  margin: 1rem auto;
  border-radius: 2px;
}

/* --- Cards --- */
.card-custom {
  background: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition);
}

.card-custom:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-custom .card-img-wrapper {
  overflow: hidden;
  position: relative;
}

.card-custom.card-apartment .card-img-wrapper {
  height: 100%;
}

.card-custom .card-img-wrapper img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-custom.card-apartment .card-img-wrapper img {
  height: 100%;
  min-height: 300px;
}

.card-custom:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.card-custom .card-body {
  padding: 1.5rem;
}

.card-custom .card-title {
  font-family: "Playfair Display", serif;
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.card-price {
  display: inline-block;
  background-color: var(--accent-warm);
  color: var(--primary-dark);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Glass Card (for detail pages) */
.card-glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

.card-glass.card-apartment,
.card-custom.card-apartment {
  max-height: 520px;
  overflow: hidden;
}

/* --- Amenities --- */
.amenity-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.amenity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--neutral-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
}

.amenity-item i {
  color: var(--accent);
  font-size: 1.1rem;
}

/* --- Carousel (Detail Pages) --- */
.carousel-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.carousel-hero .carousel-item img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.carousel-hero .carousel-control-prev,
.carousel-hero .carousel-control-next {
  width: 50px;
  height: 50px;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition);
  margin: 0 1rem;
}

.carousel-hero:hover .carousel-control-prev,
.carousel-hero:hover .carousel-control-next {
  opacity: 1;
}

.carousel-hero .carousel-control-prev-icon,
.carousel-hero .carousel-control-next-icon {
  filter: invert(1) brightness(0.3);
  width: 1rem;
  height: 1rem;
}

/* --- Pricing Table --- */
.pricing-table {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pricing-table .table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.pricing-table .table thead {
  background-color: var(--primary);
  color: var(--white);
}

.pricing-table .table thead th {
  font-weight: 600;
  padding: 1rem 0.75rem;
  border: none;
  font-size: 0.95rem;
  color: #ffffff !important;
}

.pricing-table .table tbody tr {
  transition: var(--transition);
}

.pricing-table .table tbody tr:nth-child(odd) {
  background-color: var(--neutral-light);
}

.pricing-table .table tbody tr:hover {
  background-color: var(--accent-warm);
}

.pricing-table .table td,
.pricing-table .table th {
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
  border: none;
  text-align: center;
}

.pricing-table .table tbody th {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
}

.pricing-table .table tbody td {
  font-weight: 500;
  text-align: center;
}

.season-high {
  background-color: rgba(224, 122, 95, 0.1) !important;
}

/* --- Accordion --- */
.accordion-custom .accordion-item {
  border: none;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-custom .accordion-button {
  font-weight: 600;
  color: var(--primary);
  background-color: var(--white);
  padding: 1.2rem 1.5rem;
  font-size: 1rem;
}

.accordion-custom .accordion-button:not(.collapsed) {
  background-color: var(--neutral-light);
  color: var(--primary);
  box-shadow: none;
}

.accordion-custom .accordion-button::after {
  filter: hue-rotate(180deg);
}

.accordion-custom .accordion-body {
  padding: 1.5rem;
  line-height: 1.8;
}

/* --- Contact Cards --- */
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.contact-item:hover {
  background-color: var(--neutral-light);
}

.contact-item .contact-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-item .contact-text {
  font-weight: 500;
}

.contact-item .contact-text a {
  color: var(--neutral-dark);
  font-weight: 600;
}

.contact-item .contact-text a:hover {
  color: var(--accent);
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-icons a {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.2rem;
  transition: var(--transition);
}

.social-icons a:hover {
  background-color: var(--accent);
  color: var(--white);
  transform: translateY(-3px);
}

/* --- Map Placeholder --- */
.map-placeholder {
  background-color: var(--neutral-light);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  color: var(--gray-500);
}

.map-placeholder i {
  font-size: 3rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.map-loaded {
  padding: 0;
  border: none;
  background: none;
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: none;
  display: block;
}

/* --- Directions --- */
.direction-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background-color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.direction-item .direction-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-warm);
  color: var(--primary);
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* --- Bank Info Card --- */
.bank-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.bank-card h3 {
  color: var(--white);
}

.bank-card p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.5rem;
}

.bank-card .bank-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-warm);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.bank-card .bank-value {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--white);
  font-family: "Montserrat", monospace;
}

/* --- Footer --- */
.footer {
  background-color: var(--primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
}

.footer h5 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--accent-warm);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.85rem;
}

.footer-bottom a {
  color: var(--accent-warm);
}

/* --- Wave Divider --- */
.wave-divider {
  position: relative;
  height: 80px;
  overflow: hidden;
}

.wave-divider svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
}

/* --- Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background-color: var(--white);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 250px;
  font-size: 0.9rem;
  color: var(--neutral-dark);
}

.cookie-banner-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-banner .btn-accept {
  background-color: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.cookie-banner .btn-accept:hover {
  background-color: var(--accent-hover);
}

.cookie-banner .btn-necessary {
  background-color: var(--gray-200);
  color: var(--neutral-dark);
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.cookie-banner .btn-necessary:hover {
  background-color: var(--gray-500);
  color: var(--white);
}

/* --- Breadcrumb --- */
.breadcrumb-custom {
  background: none;
  padding: 0;
  margin-bottom: 0;
}

.breadcrumb-custom .breadcrumb-item a {
  color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-custom .breadcrumb-item.active {
  color: var(--white);
  font-weight: 600;
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.5);
}

/* --- Privacy Page --- */
.privacy-content h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.privacy-content h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.privacy-content ul {
  padding-left: 1.5rem;
}

.privacy-content li {
  margin-bottom: 0.5rem;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 4rem 0;
  text-align: center;
  color: var(--white);
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
  .card-glass.card-apartment,
  .card-custom.card-apartment {
    max-height: none;
    overflow: visible;
  }

  .navbar-collapse {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    box-shadow: var(--shadow-md);
  }

  .navbar-collapse .nav-link {
    color: var(--primary) !important;
    padding: 0.75rem 1rem;
  }

  .navbar-collapse .lang-switcher a:not(.active-lang) {
    color: var(--primary) !important;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content .hero-logo {
    max-width: 440px;
    max-height: 350px;
  }

  .hero-content p {
    font-size: 1.1rem;
  }

  .carousel-hero .carousel-item img {
    height: 300px;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 575.98px) {
  .hero-content .hero-logo {
    max-width: 320px;
    max-height: 260px;
  }

  .hero-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .carousel-hero .carousel-item img {
    height: 250px;
  }

  .cookie-banner-content {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner-buttons {
    justify-content: center;
    width: 100%;
  }

  .pricing-table .table thead th {
    font-size: 0.75rem;
    padding: 0.6rem 0.35rem;
  }

  .pricing-table .table td,
  .pricing-table .table th {
    font-size: 0.78rem;
    padding: 0.55rem 0.35rem;
  }

  .pricing-table .table tbody th {
    font-size: 0.75rem;
  }
}

/* --- Utility --- */
.text-accent {
  color: var(--accent);
}

.bg-accent-warm {
  background-color: var(--accent-warm);
}

.fw-600 {
  font-weight: 600;
}
