/* Custom product slider items styling */

.custom-product-item {
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  
  .custom-product-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
  }
  
  .custom-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1; /* Takes up all available space except for actions */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevents content from overflowing */
  }
  
  .custom-product-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  .custom-product-image {
    position: relative;
    padding-top: 50%; /* Changed to 1:1 aspect ratio (square) */
    overflow: hidden;
    background-color: #fff;
    height: 0;
    max-height: 200px;
  }
  
  .custom-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
  }
  
  .custom-product-image:hover img {
    transform: scale(1.05);
  }
  
  .custom-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    z-index: 2;
  }
  
  .custom-badge.new {
    background-color: #4caf50;
  }
  
  .custom-badge.discount,
  .custom-badge.sale {
    background-color: #f44336;
  }
  
  .custom-product-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 12px;
    max-height: 120px; /* Reduced height to balance with square image */
    overflow: hidden;
  }
  
  .custom-product-title {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 500;
  }
  
  .custom-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
  }
  
  .custom-product-title a:hover {
    color: #05a9f1;
  }
  
  .custom-product-price {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .custom-current-price {
    font-size: 18px;
    font-weight: 700;
    color: #05a9f1;
  }
  
  .custom-regular-price {
    margin-right: 10px;
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
  }
  
  .custom-product-actions {
    padding: 12px;
    background-color: #fff; /* Ensures consistent background */
    border-top: 1px solid #f0f0f0; /* Optional: adds a subtle separator */
    margin-top: auto;
  }
  
  .custom-add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 15px;
    background-color: #05a9f1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .custom-add-to-cart-btn:hover {
    background-color: #0486c1;
  }
  
  .custom-add-to-cart-btn i {
    margin-right: 8px;
    font-size: 18px;
  }
  
  .custom-out-of-stock {
    display: block;
    padding: 10px 15px;
    background-color: #f5f5f5;
    color: #999;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
  }
  
  /* Special styling for the slider */
  .custom-accessories-slider .custom-product-item {
    height: 300px; /* Reduced overall height */
    max-height: 300px; /* Reduced maximum height */
  }
  
  .custom-accessories-slider .custom-product-container {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  /* Responsive adjustments */
  @media (max-width: 767px) {
    .custom-product-title {
      font-size: 14px;
    }
  
    .custom-current-price {
      font-size: 16px;
    }
  
    .custom-add-to-cart-btn {
      padding: 8px 12px;
      font-size: 13px;
    }
  
    .custom-accessories-slider .custom-product-item {
      height: 320px; /* Adjusted for more square-like appearance */
    }
  
    .custom-product-actions {
      position: relative;
      z-index: 5; /* Ensure actions are above other elements */
    }
  
    .custom-add-to-cart-form {
      position: relative;
      z-index: 10; /* Higher than parent to ensure clickability */
    }
  
    .custom-add-to-cart-btn {
      position: relative;
      z-index: 15; /* Higher than form to ensure clickability */
    }
  
    .custom-add-to-cart-btn.loading:after {
      content: "";
      position: absolute;
      width: 20px;
      height: 20px;
      top: 50%;
      left: 50%;
      margin: -10px 0 0 -10px;
      border: 3px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      border-top-color: #fff;
      animation: spin 1s ease-in-out infinite;
    }
  
    .custom-add-to-cart-btn.added {
      background-color: #4caf50;
    }
  
    .custom-add-to-cart-btn.added i:before {
      content: "check_circle";
    }
  
    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }
  
    /* Add to cart success message */
    .add-to-cart-success {
      position: absolute;
      background-color: #4caf50;
      color: white;
      padding: 8px 15px;
      border-radius: 4px;
      font-size: 14px;
      font-weight: 600;
      z-index: 1000;
      opacity: 1;
      pointer-events: none;
    }
  
    /* Cart icon animation */
    @keyframes cartPulse {
      0% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.2);
      }
      100% {
        transform: scale(1);
      }
    }
  
    .header .cart-products-count.added-to-cart {
      animation: cartPulse 0.5s ease;
      color: #4caf50;
    }
  }
  /* Media queries for responsiveness */
  @media (max-width: 991px) {
    .custom-accessories-slider .custom-product-item {
      height: 330px; /* Adjusted for more square-like appearance */
      max-height: 330px;
    }
  
    .custom-product-image {
      padding-top: 60%; /* Keep square ratio on tablets */
    }
  
    .custom-product-container {
      position: relative;
    }
  
    .custom-product-link {
      position: relative;
      z-index: 1;
    }
  }
  
  /* Fix for mobile display - updated image height ratio */
  @media (max-width: 544px) {
    /* Maintain square ratio on mobiles */
    .custom-product-image {
      padding-top: 25% !important; /* Square ratio for mobile */
    }
    
    .custom-product-details {
      max-height: 80px; /* Reduced for better balance */
      padding: 8px;
      overflow: visible; /* Allow text to be visible */
    }
    
    .custom-product-title {
      font-size: 13px;
      margin-bottom: 4px;
      line-height: 1.2;
    }
    
    .custom-product-price {
      margin-bottom: 4px;
    }
    
    .custom-current-price {
      font-size: 14px;
    }
    
    .custom-regular-price {
      font-size: 12px;
    }
    
    .custom-product-actions {
      padding: 8px;
      position: relative;
      z-index: 5;
    }
    
    .custom-add-to-cart-btn {
      padding: 6px 8px;
      font-size: 12px;
      position: relative;
      z-index: 5;
      min-height: 44px; /* Make button more tappable on mobile */
    }
    
    .custom-accessories-slider .custom-product-item {
      height: 240px; /* Adjusted for square ratio */
      max-height: 240px;
    }
    
    /* Icon-only button on mobile */
    .custom-add-to-cart-btn span {
      display: none; /* Hide text, just show icon on very small screens */
    }
    
    .custom-add-to-cart-btn i {
      margin-right: 0;
    }
  }
  
  /* Extra small devices */
  @media (max-width: 375px) {
    .custom-product-image {
      padding-top: 30% !important; /* Maintain square ratio */
    }
    
    .custom-accessories-slider .custom-product-item {
      height: 220px; /* Adjusted height for smallest screens */
      max-height: 220px;
    }
    
    .custom-product-details {
      max-height: 70px;
      padding: 6px;
    }
    
    .custom-product-title {
      font-size: 12px;
      margin-bottom: 2px;
    }
  }
