/* MARU Brand Theme - Modern Design with Animations */
:root {
  --maru-red: #9f0000;
  --maru-red-dark: #500101;
  --maru-dark: #010101;
  --maru-light: #ffffff;
  --maru-accent: #500101;
  --maru-gradient-start: #9f0000;
  --maru-gradient-end: #500101;
}

/* Page Load Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 140px;
  padding-top: 70px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.3px;
  animation: fadeInDown 0.6s ease-out;
}

@media (max-width: 576px) {
  body {
    padding-top: 70px;
    padding-bottom: 100px;
  }
}

/* Override Bootstrap primary color */
:root {
  --bs-primary: var(--maru-red);
  --bs-primary-rgb: 159, 0, 0;
  --bs-secondary: var(--maru-dark);
  --bs-secondary-rgb: 1, 1, 1;
  --bs-light: var(--maru-light);
  --bs-light-rgb: 255, 255, 255;
  --bs-danger: var(--maru-red);
}

/* Navbar Styling */
.navbar {
  background: linear-gradient(135deg, rgba(255,255,255,0.99) 0%, rgba(250,250,250,0.99) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  animation: fadeInDown 0.5s ease-out;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  min-height: 70px;
  padding: 0.5rem 0;
}

@media (max-width: 576px) {
  .navbar {
    z-index: 1001;
    min-height: 60px;
  }
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--maru-red) !important;
  letter-spacing: -0.5px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideInLeft 0.6s ease-out 0.1s both;
}

.navbar-brand:hover {
  transform: scale(1.08);
}

.navbar-logo {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: slideInLeft 0.6s ease-out 0.15s both;
}

.navbar-brand:hover .navbar-logo {
  filter: drop-shadow(0 4px 12px rgba(196, 30, 46, 0.4));
  transform: scale(1.12) rotate(-5deg);
}

@media (max-width: 576px) {
  .navbar-logo {
    height: 35px !important;
  }
}

.nav-link {
  font-weight: 600;
  color: var(--maru-dark) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  animation: fadeInDown 0.6s ease-out;
  animation-fill-mode: both;
}

.nav-link:nth-child(1) { animation-delay: 0.2s; }
.nav-link:nth-child(2) { animation-delay: 0.25s; }
.nav-link:nth-child(3) { animation-delay: 0.3s; }

.nav-link:hover {
  color: var(--maru-red) !important;
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--maru-red), var(--maru-accent));
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 2px;
}

.nav-link:hover::after {
  width: 100%;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%);
  border: none;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(159, 0, 0, 0.4);
}

.btn-primary:active {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(159, 0, 0, 0.3);
}

.btn-secondary {
  background-color: var(--maru-dark);
  border-color: var(--maru-dark);
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-secondary:hover {
  background-color: #0d0d0d;
  border-color: #0d0d0d;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-outline-primary {
  color: var(--maru-red);
  border-color: var(--maru-red);
  border-width: 2px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-outline-primary:hover {
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%);
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(159, 0, 0, 0.3);
}

.btn-light {
  background-color: white;
  border: 2px solid white;
  color: var(--maru-red);
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-light:hover {
  background: transparent;
  border-color: white;
  transform: translateY(-4px);
}

.btn-outline-light {
  color: white;
  border-color: white;
  border-width: 2px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Forms */
.form-control {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 500;
  animation: slideInUp 0.6s ease-out;
}

.form-control:focus {
  border-color: var(--maru-red);
  box-shadow: 0 0 0 0.3rem rgba(196, 30, 46, 0.15);
  transform: translateY(-2px);
}

.form-control::placeholder {
  color: #bbb;
  font-style: italic;
}

.form-label {
  font-weight: 700;
  color: var(--maru-dark);
  margin-bottom: 0.5rem;
}

.form-check-input {
  width: 1.3em;
  height: 1.3em;
  border-radius: 4px;
  border: 2px solid #ddd;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-check-input:checked {
  background: linear-gradient(135deg, var(--maru-red), var(--maru-accent));
  border-color: transparent;
}

.form-check-input:focus {
  border-color: var(--maru-red);
  box-shadow: 0 0 0 0.25rem rgba(196, 30, 46, 0.25);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--maru-dark);
  font-weight: 800;
  letter-spacing: -0.5px;
  animation: fadeInUp 0.6s ease-out;
}

h1 {
  color: var(--maru-red);
  font-size: 2.8rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--maru-red), var(--maru-accent));
  border-radius: 2px;
}

h3 {
  font-size: 1.5rem;
}

h4, h5, h6 {
  font-size: 1.2rem;
}

/* Cards */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fadeInUp 0.6s ease-out;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid rgba(159, 0, 0, 0.08);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 40px rgba(196, 30, 46, 0.2);
  border-color: var(--maru-red);
}

.card-header {
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%);
  color: white;
  border: none;
  font-weight: 700;
  padding: 1.5rem;
  border-radius: 12px 12px 0 0;
}

.card-body {
  padding: 1.5rem;
  font-weight: 500;
}

.card-body p {
  color: #333;
  line-height: 1.8;
}

/* Badges */
.badge {
  font-weight: 700;
  padding: 0.6rem 0.9rem;
  border-radius: 20px;
  animation: scaleIn 0.4s ease-out;
}

.badge.bg-primary {
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%) !important;
  box-shadow: 0 4px 12px rgba(159, 0, 0, 0.3);
}

.badge.bg-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800) !important;
  color: white;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Lists */
.list-group-item {
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideInUp 0.6s ease-out;
  background: white;
}

.list-group-item:nth-child(1) { animation-delay: 0.1s; }
.list-group-item:nth-child(2) { animation-delay: 0.2s; }
.list-group-item:nth-child(3) { animation-delay: 0.3s; }

.list-group-item:hover {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-color: var(--maru-red);
  padding-left: 1.5rem;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(159, 0, 0, 0.15);
}

.list-group-item.active {
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%);
  border-color: transparent;
  color: white;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%);
  color: white;
  padding: 5rem 2rem;
  border-radius: 12px;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  animation: fadeInDown 0.8s ease-out;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400"><circle cx="100" cy="100" r="80" fill="rgba(255,255,255,0.1)"/><circle cx="900" cy="300" r="150" fill="rgba(255,255,255,0.08)"/></svg>');
  animation: pulse 8s ease-in-out infinite;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: white;
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero p {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 500;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero .btn {
  animation: scaleIn 0.6s ease-out 0.6s both;
}

.hero-subtext {
  font-size: 1.1rem;
  opacity: 0.9;
  animation: fadeInUp 0.8s ease-out 0.5s both;
  margin-bottom: 1.5rem;
}

/* Stats Section */
.stats-section {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fadeInUp 0.6s ease-out;
  height: 100%;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card:hover {
  border-color: var(--maru-red);
  box-shadow: 0 12px 30px rgba(159, 0, 0, 0.2);
  transform: translateY(-8px);
}

.stat-number {
  color: var(--maru-red);
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  color: #666;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0;
}

.bg-light-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.card-footer {
  padding: 0.5rem 1.5rem 0 1.5rem;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  color: #333;
  margin-top: auto;
  padding: 1.2rem 0;
  border-top: 3px solid var(--maru-red);
  animation: fadeInUp 0.8s ease-out;
  flex-shrink: 0;
  width: 100%;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
}

footer .container {
  padding-left: 1rem;
  padding-right: 1rem;
}

footer h5 {
  color: var(--maru-red);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  animation: slideInLeft 0.6s ease-out 0.2s both;
  margin-bottom: 1rem;
}

.footer-title {
  border-bottom: 2px solid rgba(196, 30, 46, 0.2);
  padding-bottom: 0.5rem;
}

footer p {
  animation: fadeInUp 0.6s ease-out 0.3s both;
  line-height: 1.4;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 0.3rem;
}

footer a {
  color: var(--maru-red);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

footer a:hover {
  color: var(--maru-accent);
  text-decoration: underline;
}

.footer-section {
  padding: 1rem 0.5rem;
  line-height: 1.8;
}

.footer-section h6 {
  color: var(--maru-dark);
  font-weight: 800;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.3rem;
}

.footer-section ul li a {
  color: #777;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.footer-section ul li a:hover {
  color: var(--maru-red);
  padding-left: 3px;
}

.footer-contact-info {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.contact-label {
  font-weight: 700;
  color: #333;
  min-width: 60px;
}

.contact-link {
  color: var(--maru-red);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-link:hover {
  color: var(--maru-accent);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 2px solid rgba(159, 0, 0, 0.15);
  margin-top: 1.5rem;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #777;
}

.footer-bottom p {
  animation: none;
  margin-bottom: 0;
  font-weight: 500;
}

.footer-bottom a {
  color: var(--maru-red);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-bottom a:hover {
  color: var(--maru-accent);
  text-decoration: underline;
}

/* Alerts */
.alert {
  border-radius: 8px;
  border: 2px solid;
  font-weight: 600;
  animation: slideInUp 0.6s ease-out;
}

.alert-primary {
  background: linear-gradient(135deg, rgba(159, 0, 0, 0.08) 0%, rgba(80, 1, 1, 0.04) 100%);
  border-color: var(--maru-red);
  color: var(--maru-dark);
}

.alert-primary strong {
  color: var(--maru-red);
  font-weight: 800;
}

.alert-info {
  background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.05) 100%);
  border-color: #17a2b8;
  color: var(--maru-dark);
}

.alert-info strong {
  color: #17a2b8;
  font-weight: 800;
}

/* Floating elements */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--maru-red);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Breadcrumbs */
.breadcrumb {
  background-color: var(--maru-light);
  border-radius: 4px;
}

.breadcrumb .breadcrumb-item.active {
  color: var(--maru-red);
  font-weight: 600;
}

.breadcrumb .breadcrumb-item a {
  color: var(--maru-dark);
  text-decoration: none;
}

.breadcrumb .breadcrumb-item a:hover {
  color: var(--maru-red);
}

/* Services Page Styling */
.service-item {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  height: 100%;
  animation: slideInUp 0.6s ease-out;
}

.service-item:hover {
  border-color: #9f0000;
  box-shadow: 0 8px 20px rgba(159, 0, 0, 0.15);
  transform: translateY(-5px);
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.service-header h5 {
  color: #c41e2e;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0;
  flex: 1;
}

.service-icon {
  color: #c41e2e;
  font-size: 1.5rem;
  font-weight: bold;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-item:hover .service-icon {
  opacity: 1;
  transform: translateX(5px);
}

.service-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.service-category {
  animation: fadeInUp 0.6s ease-out;
}

/* Smooth transitions */
* {
  transition: color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Container animations */
.container {
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

/* Text animations */
p {
  animation: fadeInUp 0.6s ease-out;
}

p:nth-of-type(1) { animation-delay: 0.2s; }
p:nth-of-type(2) { animation-delay: 0.3s; }
p:nth-of-type(3) { animation-delay: 0.4s; }

/* Row animations */
.row {
  animation: fadeInUp 0.6s ease-out;
}

/* Stagger effect for multiple rows */
.row:nth-of-type(2) { animation-delay: 0.2s; }
.row:nth-of-type(3) { animation-delay: 0.3s; }

/* Loading animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .col-lg-3 {
    flex: 0 0 25%;
    width: 25%;
  }
}

@media (max-width: 992px) {
  .col-lg-3 {
    flex: 0 0 50%;
    width: 50%;
  }

  body {
    padding-top: 80px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem !important;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 3rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .card {
    margin-bottom: 1rem;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }

  .col-lg-3 {
    flex: 0 0 100%;
    width: 100%;
  }

  body {
    padding-top: 70px;
  }

  @media (max-width: 576px) {
    .col-md-4 {
      width: 100% !important;
    }
  }
}

/* Carousel Styling */
.carousel {
  margin-top: 0;
  position: relative;
  margin-bottom: 3rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* prevent child overflow on small screens */
}

.carousel-fullwidth {
  margin-bottom: 0;
  padding-top: 0;
}

.carousel-placeholder {
  display: block;
  width: 100%;
  height: 500px;
  background-color: rgba(255, 255, 255, 0.05);
}

.carousel-bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.carousel-item {
  height: 500px;
  min-height: 400px;
  color: white;
  position: relative;
  display: none;
  float: left;
  width: 100%;
  margin-right: -100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: opacity 0.6s ease-in-out;
  overflow: hidden;
}

.carousel-item.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.carousel-item-next,
.carousel-item-prev {
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-fade .carousel-item {
  opacity: 0;
  transition-property: opacity;
}

.carousel-fade .carousel-item.active {
  opacity: 1;
}

.carousel-fade .carousel-item-next.carousel-item-left,
.carousel-fade .carousel-item-prev.carousel-item-right {
  z-index: 1;
  opacity: 1;
}

.carousel-service-image {
  position: absolute;
  width: clamp(180px, 35vw, 400px);
  height: auto;
  max-width: 90%;
  opacity: 0.95;
  animation: scaleIn 0.8s ease-out;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.carousel-caption {
  position: absolute;
  right: 5%;
  bottom: 20px;
  left: 5%;
  z-index: 10;
  padding: 25px 20px;
  color: #fff;
  text-align: center;
  animation: slideInUp 0.8s ease-out;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8));
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 90vw;
}

@media (min-width: 768px) {
  .carousel-caption {
    right: 15%;
    left: 15%;
    bottom: 30px;
  }

  .carousel-service-image {
    width: clamp(260px, 30vw, 480px);
    height: auto;
  }
}

.carousel-caption h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
  letter-spacing: -1px;
  line-height: 1.2;
  color: #ffffff;
}

.carousel-caption p {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  font-weight: 500;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  line-height: 1.5;
  color: #ffffff;
}

.carousel-indicators {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  padding: 0;
  margin-right: 15%;
  margin-bottom: 0;
  margin-left: 15%;
  list-style: none;
}

.carousel-indicators [data-bs-slide-to] {
  box-sizing: content-box;
  flex: 0 1 auto;
  width: 25px;
  height: 2px;
  padding: 0;
  margin-right: 3px;
  margin-left: 3px;
  text-indent: -999px;
  cursor: pointer;
  background-color: #fff;
  background-clip: padding-box;
  border: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  opacity: 0.5;
  transition: opacity 0.6s ease;
}

.carousel-indicators .active {
  opacity: 1;
  background-color: var(--maru-red);
}

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15%;
  padding: 0;
  color: #fff;
  text-align: center;
  background: none;
  border: none;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.carousel-control-prev:hover,
.carousel-control-prev:focus,
.carousel-control-next:hover,
.carousel-control-next:focus {
  color: #fff;
  text-decoration: none;
  outline: 0;
  opacity: 0.9;
}

.carousel-control-prev {
  left: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0%, transparent 100%);
}

.carousel-control-next {
  right: 0;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.25) 0%, transparent 100%);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  background-repeat: no-repeat;
  background-position: 50%;
  background-size: 100% 100%;
}

.carousel-control-prev-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.carousel-control-next-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

@media (max-width: 768px) {
  .carousel-caption h1 {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
  }

  .carousel-caption p {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
  }

  .carousel-caption {
    padding: 18px 12px;
    bottom: 15px;
  }

  .carousel-item {
    height: 420px;
  }

  .carousel-service-image {
    width: 260px;
    height: 260px;
  }

  .carousel-indicators {
    margin-right: 5%;
    margin-left: 5%;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 25%;
  }
}

@media (max-width: 576px) {
  .carousel-caption h1 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .carousel-caption p {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .carousel-caption {
    padding: 12px 10px;
    bottom: 10px;
    right: 3%;
    left: 3%;
  }

  .carousel-item {
    height: auto; /* allow content to flow naturally */
    padding: 12px 0 20px;
    align-items: flex-start;
  }

  /* Stack the service image above the caption to avoid overlap */
  .carousel-service-image {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: 0 auto 8px auto;
    width: min(60vw, 220px);
    height: auto;
  }

  .carousel-caption .btn {
    padding: 0.35rem 0.7rem !important;
    font-size: 0.8rem !important;
  }
}

/* WhatsApp Agent Widget */
.whatsapp-agent-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.whatsapp-button-container {
  position: relative;
}

.whatsapp-main-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(159, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: pulse 2s infinite;
}

.whatsapp-main-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(159, 0, 0, 0.5);
}

.whatsapp-main-btn.active {
  background: linear-gradient(135deg, var(--maru-accent) 0%, var(--maru-red) 100%);
  transform: scale(0.95) rotate(-45deg);
  animation: none;
}

.whatsapp-menu {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.whatsapp-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.whatsapp-header {
  background: linear-gradient(135deg, var(--maru-red) 0%, var(--maru-accent) 100%);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.whatsapp-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.whatsapp-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.whatsapp-close-btn:hover {
  transform: rotate(90deg);
}

.whatsapp-content {
  padding: 16px;
}

.whatsapp-subtitle {
  margin: 0 0 16px 0;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.whatsapp-option {
  display: flex;
  align-items: center;
  padding: 14px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #f5f6f7;
  text-decoration: none;
  color: #333;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid transparent;
  cursor: pointer;
  gap: 12px;
}

.whatsapp-option:hover {
  background: #eff6ff;
  border-color: var(--maru-red);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(159, 0, 0, 0.15);
}

.whatsapp-option.whatsapp-option-link {
  border-color: var(--maru-red);
  background: linear-gradient(135deg, rgba(159, 0, 0, 0.08) 0%, rgba(80, 1, 1, 0.04) 100%);
}

.whatsapp-option.whatsapp-option-link:hover {
  background: linear-gradient(135deg, rgba(159, 0, 0, 0.15) 0%, rgba(80, 1, 1, 0.08) 100%);
  box-shadow: 0 6px 16px rgba(159, 0, 0, 0.2);
}

.whatsapp-icon {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(159, 0, 0, 0.08);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.whatsapp-option:hover .whatsapp-icon {
  background: rgba(159, 0, 0, 0.15);
  transform: scale(1.1);
}

.whatsapp-option-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 3px;
}

.whatsapp-option-text strong {
  font-size: 1rem;
  color: #1a1a1a;
  font-weight: 700;
  line-height: 1.3;
}

.whatsapp-option-text span {
  font-size: 0.88rem;
  color: #666;
  font-weight: 500;
}

.whatsapp-option:hover .whatsapp-option-text strong {
  color: var(--maru-red);
}

.whatsapp-footer {
  padding: 10px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
  .footer-section {
    margin-bottom: 1.5rem;\n  }

  .footer-contact-info {\n    font-size: 0.85rem;\n  }

  .social-media-links {
    gap: 10px;
  }

  .social-link {
    width: 44px;
    height: 44px;
  }

  .social-link svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 576px) {
  .footer-section {
    text-align: center;
    margin-bottom: 1rem;
  }

  .footer-title {
    font-size: 0.95rem;
    padding-bottom: 0.4rem;
    margin-bottom: 0.8rem;
  }

  .footer-contact-info {
    font-size: 0.8rem;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .contact-label {
    min-width: auto;
  }

  .social-media-links {
    gap: 8px;
    justify-content: center;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  .social-link svg {
    width: 18px;
    height: 18px;
  }

  .whatsapp-agent-widget {
    bottom: 80px;
    right: 15px;
    z-index: 998;
  }

  .whatsapp-main-btn {
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 15px rgba(159, 0, 0, 0.4);
  }

  .whatsapp-menu {
    width: 280px;
    bottom: 75px;
    right: -15px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }

  .whatsapp-option {
    padding: 12px 12px;
    margin-bottom: 10px;
    font-size: 0.95rem;
  }

  .whatsapp-icon {
    font-size: 26px;
    width: 38px;
    height: 38px;
  }

  .whatsapp-option-text strong {
    font-size: 0.95rem;
  }

  .whatsapp-option-text span {
    font-size: 0.85rem;
  }
}

/* Social Media Links in Footer */
.social-media-links {
  display: flex;
  gap: 12px;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(159, 0, 0, 0.08);
  color: #9f0000;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(159, 0, 0, 0.1);
  flex-shrink: 0;
}

.social-link svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.social-link:hover {
  background: linear-gradient(135deg, #9f0000 0%, #500101 100%);
  color: white;
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 20px rgba(159, 0, 0, 0.35);
  border-color: transparent;
}

.social-link:hover svg {
  transform: scale(1.15);
}

.social-link.facebook {
  border-color: rgba(59, 89, 152, 0.3);
}

.social-link.facebook:hover {
  background: linear-gradient(135deg, #3b5998 0%, #1e3a5f 100%);
}

.social-link.linkedin {
  border-color: rgba(0, 119, 181, 0.3);
}

.social-link.linkedin:hover {
  background: linear-gradient(135deg, #0077b5 0%, #005882 100%);
}

.social-link.youtube {
  border-color: rgba(255, 0, 0, 0.3);
}

.social-link.youtube:hover {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
}

@media (max-width: 768px) {
  .social-media-links {
    gap: 12px;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  .social-link svg {
    width: 20px;
    height: 20px;
  }
}