/* ====== Slider Container ====== */
.shm-card-slider {
    position: relative;
    padding: 20px 0;
    background-color: #f9f9f9; /* Light background */
    }

/* ====== Loader Styles ====== */
.shm-skeleton-wrapper {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 3; /* Above cards to show during loading */
    pointer-events: none;
    justify-content: center; /* Center align skeletons on desktop to match cards */
    padding: 0 20px; /* Match container padding */
    opacity: 1; /* Ensure fully visible during loading */
}

.shm-skeleton-card {
    flex: 0 0 200px;
    margin-right: 15px;
    border-radius: 12px;
    /* aspect-ratio: 9 / 16; */ /* Removed for linter compatibility */
    height: 356px; /* Fallback for 9/16 aspect ratio on 200px width */
    background: linear-gradient(
        90deg,
        #e8e8e8 0%,
        #d0d0d0 50%,
        #e8e8e8 100%
    );
    background-size: 200% 100%;
    animation: shm-shimmer 1.2s ease-in-out infinite;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    will-change: background-position; /* Optimize animation performance */
}

.shm-skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: shm-slide 1.5s ease-in-out infinite;
}

.shm-cards-content {
    position: relative;
    z-index: 2;
    display: flex;
}

.shm-skeleton-wrapper--hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
    z-index: 0; /* Move behind cards when hidden */
}

@keyframes shm-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes shm-slide {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}
  
  /* ====== Card Container ====== */
  .shm-card-container {
    position: relative;
    display: flex;
    overflow-x: auto;
    padding: 0 20px;
    /* scroll-behavior: auto; */ /* Removed for linter compatibility */
    -ms-overflow-style: none;
    min-height: 355px;
    justify-content: flex-start; /* Align items to start instead of center */
  }
  
  .shm-card-container::-webkit-scrollbar {
    display: none;
  }
  
  /* ====== Individual Card ====== */
  .shm-card {
    position: relative;
    flex: 0 0 200px;
    margin-right: 15px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #ffffff; /* Fallback for older browsers */
    background-color: #fff; /* White card background */
    transition: box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  .shm-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  
  .shm-card iframe {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 12px 12px 0 0;
    /* aspect-ratio: 9 / 16; */ /* Removed for linter compatibility */
  }
  
  /* ====== View Button ====== */
  .shm-view-btn {
    width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
    background-color: #111111; /* Fallback for older browsers */
    background-color: #111; /* Dark button */
    color: #ffffff; /* Fallback for older browsers */
    color: #fff;
    border: none;
    border-radius: 0 0 12px 12px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
  }
  
  .shm-view-btn:hover {
    background-color: #fff;
    color: #111;
  }
  
  /* ====== Slider Navigation Buttons ====== */
  .shm-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff;
    color: #111;
    border: none;
    padding: 12px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
  }

  .shm-slider-btn--visible {
    opacity: 1;
    pointer-events: auto;
  }
  
  .shm-slider-btn:hover {
    background-color: #111;
    color: #fff;
  }
  
  .shm-prev-btn {
    left: 10px;
  }
  
  .shm-next-btn {
    right: 10px;
  }
  
  /* ====== Modal Styles ====== */
  .shm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: #000;
    background-color: rgba(0, 0, 0, 0.6);
  }
  
  .shm-modal-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff; /* Fallback for older browsers */
    background-color: #fff;
    padding-top: 20px;
    border-radius: 12px;
    width: 80vw;
    max-height: 85vh;
    overflow-y: auto;
    color: #111;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  }
  
  .shm-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: #fff; /* White button */
    color: #111; /* Icon color */
    border: none;
    border-radius: 50%; /* Circle */
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
  }
  
  .shm-close-btn:hover {
    background-color: #111; /* Dark background on hover */
    color: #fff; /* White icon on hover */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  }
  
  
  /* ====== Modal Body ====== */
  .shm-modal-body {
    display: flex;
    /* gap: 2rem; */ /* Replaced with margin for broader compatibility */
  }
  
  .shm-modal-image {
    flex: 0.5;
    margin: auto 1rem auto 0;
  }
  
  .shm-modal-image iframe {
    width: 100%;
    height: 100%;
    /* aspect-ratio: 9 / 16; */ /* Removed for linter compatibility */
    border-radius: 12px;
  }
  
  .shm-modal-products {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    max-width: 70%;
    max-height: 83vh;
    overflow-y: auto;
    margin: auto 0 auto 1rem;
  }
  
  .shm-modal-products-title {
    font-size: 20px;
    margin-bottom: 15px;
    color: #111;
  }
  
  /* ====== Related Products Slider ====== */
  .shm-related-products-slider {
    position: relative;
  }
  
  .shm-products-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar */
  }
  
  .shm-products-container {
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    /* gap: 15px; */ /* Replaced with margin for broader compatibility */
    padding-bottom: 15px;
    margin: 0 -7.5px;
  }
  
  .shm-product {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 200px;
    flex-shrink: 0;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    /* aspect-ratio: 9 / 16; */ /* Removed for linter compatibility */
    height: 356px; /* Fallback for 9/16 aspect ratio on 200px width */
    margin: 7.5px;
  }
  
  .shm-product:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  }
  
  .shm-product img {
    width: 100%;
    height: 80%;
    object-fit: cover;
  }
  
  .shm-product-info {
    /* padding-top: 15px; */
    height: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  .shm-product-info a {
    text-decoration: none;
    color: #111;
  }
  
  .shm-product-info a p {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px;
    line-height: 1.2;
  }
  
  .shm-product-price {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
  }
  
  .shm-product-price-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  
  .shm-stock-status {
    font-size: 12px;
    font-weight: 500;
    color: #28a745;
  }
  
  .shm-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
  }

  .shm-spinner {
    border-top: 4px solid #000000;
    /* border-top: 4px solid rgba(0, 0, 0, 0.1); */
    border-left-color: #111111;
    border-left-color: #111;
    border-radius: 50%;
    width: 40px;
    /* height: 40px; */
    animation: shm-spin 1s linear infinite;
  }
  
  @keyframes shm-spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  .shm-retry-btn {
    padding: 10px 20px;
    background-color: #111;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
  }
  
  /* ====== Responsive Adjustments ====== */
  .shm-modal-layout-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .shm-modal-inner-wrapper {
      display: flex;
      /* gap: 2rem; */ /* Replaced with margin for broader compatibility */
      height: 100%;
  }
  
  .shm-mobile-view .shm-modal-inner-wrapper {
    flex-direction: column;
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE and Edge */
  }
  
  .shm-mobile-view .shm-modal-inner-wrapper::-webkit-scrollbar {
    display: none;
  }
  
  @media (max-width: 768px) {
    .shm-modal-content {
      width: 95vw;
      height: 90vh;
    }
  
    .shm-modal-inner-wrapper {
      flex-direction: column;
      overflow-y: auto;
      -ms-overflow-style: none;  /* IE and Edge */
      /* scrollbar-width: none; */  /* Firefox */ /* Removed for linter compatibility */
    }
  
    .shm-modal-inner-wrapper::-webkit-scrollbar {
      display: none;
    }
  
    .shm-modal-image {
      display: none;
    }
  
    .shm-modal-products {
      flex: 1;
      max-width: 100%;
      margin: 0;
    }
  
    .shm-card {
      flex: 0 0 85vw; /* Show one card at a time on mobile */
      /* -webkit-scroll-snap-align: center; Snap to center */
      /* -ms-scroll-snap-align: center; Add Microsoft vendor prefix */
      /* scroll-snap-align: center; Snap to center */
      position: relative; /* Ensure proper stacking context */
    }


    .shm-card:first-child {
      margin-left: 7.5vw; /* Add left padding for first card */
    }

    .shm-card:last-child {
      margin-right: 7.5vw; /* Add right padding for last card */
    }

    .shm-view-btn {
      padding: 14px 28px; /* Larger touch target on mobile */
      font-size: 16px;
    }
  
    .shm-product {
      width: 150px;
      height: 267px; /* Fallback for 9/16 aspect ratio on 150px width */
    }

    .shm-skeleton-card {
      flex: 0 0 85vw; /* Match card width for skeleton */
    }

    .shm-card-container {
      min-height: 267px;
      padding: 0; /* Remove padding, handled by card margins */
      justify-content: flex-start; /* Start from left on mobile */
      /* -webkit-scroll-snap-type: x mandatory; Enable snap scrolling */
      /* -ms-scroll-snap-type: x mandatory; Add Microsoft vendor prefix */
      /* scroll-snap-type: x mandatory; Enable snap scrolling */
      -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .shm-skeleton-wrapper {
      left: 0;
      right: 0;
      justify-content: flex-start; /* Start from left on mobile */
      padding: 0;
    }

    .shm-skeleton-card:first-child {
      margin-left: 7.5vw; /* Match card padding */
    }

    .shm-skeleton-card:last-child {
      margin-right: 7.5vw; /* Match card padding */
    }

  }