/* Mesa Circular Menu - Frontend Styles */

:root {
  --mcm-bg-color: #f5a623;
  --mcm-circle-color: #ffffff;
  --mcm-text-color: #333333;
  --mcm-hover-scale: 1.15;
  --mcm-animation-duration: 0.3s;
}

.mcm-menu-container {
  background: transparent;
  padding: 60px 20px;
  border-radius: 20px;
  position: relative;
  overflow: visible;
  min-height: 500px;
}

/* Circular layout for desktop */
.mcm-menu-grid {
    position: relative;
    width: 100%;
    max-width: 650px;
    height: 650px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcm-menu-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all var(--animation-duration, var(--mcm-animation-duration)) cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    left: 50%;
    top: 50%;
}

/* Circular positioning - 8 items evenly distributed in a circle */
/* Using radius of 207px from center (+15% from 180px) */
/* NOTE: nth-child starts at 2 because central logo is child 1 */

.mcm-menu-item:nth-child(2) {
    /* 0° - Top - Spesa */
    transform: translate(-50%, -50%) translate(0px, -207px);
}

.mcm-menu-item:nth-child(3) {
    /* 45° - Top Right - Arcaplanet */
    transform: translate(-50%, -50%) translate(146px, -146px);
}

.mcm-menu-item:nth-child(4) {
    /* 90° - Right - Cibo */
    transform: translate(-50%, -50%) translate(207px, 0px);
}

.mcm-menu-item:nth-child(5) {
    /* 135° - Bottom Right - Honolulu */
    transform: translate(-50%, -50%) translate(146px, 146px);
}

.mcm-menu-item:nth-child(6) {
    /* 180° - Bottom - Nuts */
    transform: translate(-50%, -50%) translate(0px, 207px);
}

.mcm-menu-item:nth-child(7) {
    /* 225° - Bottom Left - Spedizioni */
    transform: translate(-50%, -50%) translate(-146px, 146px);
}

.mcm-menu-item:nth-child(8) {
    /* 270° - Left - Negozi */
    transform: translate(-50%, -50%) translate(-207px, 0px);
}

.mcm-menu-item:nth-child(9) {
    /* 315° - Top Left - Parafarmacia */
    transform: translate(-50%, -50%) translate(-146px, -146px);
}

/* Central logo at the center */
.mcm-central-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcm-central-circle {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #F5A623 0%, #FF8C42 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(245, 166, 35, 0.4);
    border: 4px solid white;
}

.mcm-central-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* Circle styling */
.mcm-circle {
  width: 140px;
  height: 140px;
  background: var(--circle-color, var(--mcm-circle-color));
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: all var(--animation-duration, var(--mcm-animation-duration))
    cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* Icon styling */
.mcm-icon {
  width: 55px;
  height: 55px;
  object-fit: contain;
  transition: all var(--animation-duration, var(--mcm-animation-duration)) ease;
  position: relative;
  z-index: 2;
  margin-bottom: 5px;
}

/* Title styling - now inside circle */
.mcm-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-color, var(--mcm-text-color));
  text-align: center;
  line-height: 1.2;
  transition: all var(--animation-duration, var(--mcm-animation-duration)) ease;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  position: relative;
  z-index: 2;
  width: 100%;
  word-wrap: break-word;
}

/* Hover effects */
.mcm-menu-item:hover .mcm-circle {
  transform: scale(var(--hover-scale, var(--mcm-hover-scale)));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.mcm-menu-item:hover .mcm-icon {
    transform: scale(1.1);
}

/* Title stays in place on hover since it's inside circle */

/* Active/Focus states for accessibility */
.mcm-menu-item:focus {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 5px;
  border-radius: 50%;
}

.mcm-menu-item:active .mcm-circle {
  transform: scale(0.95);
}

/* Glassmorphism effect on hover */
.mcm-circle::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  opacity: 0;
  transition: opacity var(--animation-duration, var(--mcm-animation-duration))
    ease;
}

.mcm-menu-item:hover .mcm-circle::before {
  opacity: 1;
}

/* Mobile Layout - Responsive Grid */
@media (max-width: 768px) {
  .mcm-menu-container {
    padding: 40px 20px;
    min-height: auto;
  }

  .mcm-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    height: auto;
    max-width: 400px;
  }

  .mcm-menu-item {
    position: static !important;
  }
  
  /* Reset all circular transforms for mobile */
  .mcm-menu-item:nth-child(2),
  .mcm-menu-item:nth-child(3),
  .mcm-menu-item:nth-child(4),
  .mcm-menu-item:nth-child(5),
  .mcm-menu-item:nth-child(6),
  .mcm-menu-item:nth-child(7),
  .mcm-menu-item:nth-child(8),
  .mcm-menu-item:nth-child(9) {
    transform: none !important;
  }

  .mcm-circle {
    width: 120px;
    height: 120px;
  }

  .mcm-icon {
    width: 50px;
    height: 50px;
  }

  .mcm-title {
    font-size: 11px;
  }

  .mcm-menu-item:hover .mcm-circle {
    transform: scale(1.1);
  }
  
  /* Hide central logo on mobile */
  .mcm-central-logo {
    display: none;
  }
}

@media (max-width: 480px) {
  .mcm-circle {
    width: 100px;
    height: 100px;
  }

  .mcm-icon {
    width: 45px;
    height: 45px;
  }

  .mcm-title {
    font-size: 10px;
    margin-top: 3px;
  }

  .mcm-menu-grid {
    gap: 20px;
  }
}

/* Animation on page load */
@keyframes mcmFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mcm-menu-item {
  animation: mcmFadeInUp 0.6s ease backwards;
}

.mcm-menu-item:nth-child(2) {
  animation-delay: 0.1s;
}
.mcm-menu-item:nth-child(3) {
  animation-delay: 0.15s;
}
.mcm-menu-item:nth-child(4) {
  animation-delay: 0.2s;
}
.mcm-menu-item:nth-child(5) {
  animation-delay: 0.25s;
}
.mcm-menu-item:nth-child(6) {
  animation-delay: 0.3s;
}
.mcm-menu-item:nth-child(7) {
  animation-delay: 0.35s;
}
.mcm-menu-item:nth-child(8) {
  animation-delay: 0.4s;
}
.mcm-menu-item:nth-child(9) {
  animation-delay: 0.45s;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .mcm-menu-item:active .mcm-circle {
    transform: scale(var(--hover-scale, var(--mcm-hover-scale)));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  }

  .mcm-menu-item:active .mcm-icon {
    transform: scale(1.1);
  }
}
