/* Custom button styles for product page */

/* Common styles for buttons */
.contact-btn {
  height: 50px;
  font-size: 16px;
  padding: 0 30px;
  margin: 0 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 40px;
}

/* =============================
   Blog single: hero action buttons
   ============================= */
.post-actions {
  gap: 0.5rem;
}

.post-actions .btn {
  border-radius: 999px; /* pill */
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: all .2s ease-in-out;
}

.post-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Brand-tinted outlines */
.post-actions .btn-outline-primary {
  --bs-btn-color: #9d101c;
  --bs-btn-border-color: #9d101c;
  --bs-btn-hover-bg: #9d101c;
  --bs-btn-hover-border-color: #9d101c;
  --bs-btn-active-bg: #7d0d16;
  --bs-btn-active-border-color: #7d0d16;
}

.post-actions .btn-outline-secondary {
  --bs-btn-color: #2B2D42; /* site dark */
  --bs-btn-border-color: #2B2D42; /* site dark border */
  --bs-btn-hover-bg: #2B2D42; /* fill on hover */
  --bs-btn-hover-border-color: #2B2D42;
  --bs-btn-active-bg: #1f2130; /* slightly darker active */
  --bs-btn-active-border-color: #1f2130;
  --bs-btn-hover-color: #ffffff; /* text turns white on hover */
}

.post-actions .btn:focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(157,16,28,0.2);
}

@media (max-width: 576px) {
  .post-actions .btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.95rem;
  }
}

/* Icon spacing */
.contact-btn i {
  margin-right: 10px;
  font-size: 18px;
}

/* Style for product buttons in related products section */
.product-btn {
  height: 40px;
  font-size: 14px;
  padding: 0 20px;
  background-color: #9d101c;
  color: #FFF;
  border: none;
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: 600;
  text-decoration: none;
}

.product-btn:hover,
.product-btn:active,
.product-btn:focus,
.product-btn:visited {
  color: #FFF;
  text-decoration: none;
}


/* Center the Buy Now button in product-actions div */
.product-actions {
  display: flex;
  justify-content: center;
  padding: 5px 0;
  margin-top: -5px;
  margin-bottom: 15px;
}

/* SmartWare Action Buttons Container */
.smartware-action-buttons {
  background: white;
  padding: 20px;
  margin-top: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Buy Now Button */
.smartware-action-buttons .buy-now-btn {
  width: 100%;
  background-color: #9d101c;
  color: white;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 16px;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  transition: 0.3s ease;
  box-shadow: 0 4px 15px rgba(157, 16, 28, 0.3);
}

.smartware-action-buttons .buy-now-btn:hover {
  background-color: #7d0d16;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(157, 16, 28, 0.4);
}

/* Secondary Buttons Container */
.smartware-secondary-buttons {
  display: flex;
  gap: 12px;
}

/* Secondary Buttons (Call Us and WhatsApp Us) */
.smartware-secondary-buttons a {
  flex: 1;
  background: transparent;
  border: 2px solid #9d101c;
  color: #9d101c;
  font-weight: 600;
  font-size: 16px;
  padding: 14px;
  text-align: center;
  border-radius: 10px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  gap: 8px;
}

.smartware-secondary-buttons a:hover {
  background-color: #9d101c;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Icons in Secondary Buttons */
.smartware-secondary-buttons svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* =============================
   Blog single: Related posts header
   ============================= */
.related-header h2 {
  font-weight: 800;
  letter-spacing: .2px;
}

.related-view-all {
  color: #9d101c; /* brand */
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.related-view-all i { color: #9d101c; transition: transform .15s ease; }

.related-view-all:hover {
  text-decoration: underline;
}

.related-view-all:hover i { transform: translateX(2px); }

/* =============================
   Blog single: Related posts grid cards
   ============================= */
.related-grid .card {
  border: 1px solid #e6e9ef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(16,24,40,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.related-grid .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16,24,40,0.12);
}

.related-grid .card-img-top {
  height: 160px;
  object-fit: cover;
  display: block;
}

.related-grid .badge.bg-secondary {
  background-color: #2B2D42 !important; /* site dark */
}

.related-grid .card-title a {
  color: #212529;
  text-decoration: none;
}

.related-grid .card-title a:hover {
  color: #9d101c; /* brand */
  text-decoration: underline;
}

/* Related card footer READ + arrow */
.related-card__footer { margin-top: auto; }
.related-card__read {
  color: #9d101c; /* brand */
  font-weight: 600;
  text-decoration: none;
}
.related-card__read:hover { text-decoration: underline; }
.related-card__arrow { color: #9d101c; font-size: 18px; }

/* WhatsApp Button Specific Styling - Same as Call Us */
.smartware-secondary-buttons a[href*="wa.me"] {
  border-color: #9d101c;
  color: #9d101c;
}

.smartware-secondary-buttons a[href*="wa.me"]:hover {
  background-color: #9d101c;
  color: white;
}

/* Brands Carousel Styles */
.brands-carousel {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 30px 0; /* Remove horizontal margin */
  background: #f5f5f5;
  border-radius: 8px;
  box-shadow: none;
  overflow: visible; /* Ensure arrows are visible outside container */
}

.brands-slider {
  display: flex;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
  width: 100%;
  padding: 0;
  background-color: #fff;
  border-radius: 8px;
  margin: 0 20px; /* Add margin for space between content and arrows */
}

.brands-slider::-webkit-scrollbar {
  display: none;
}

.brand-item {
  flex: 0 0 25%;
  min-width: 200px;
  padding: 0 15px;
  box-sizing: border-box;
}

.brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  padding: 15px;
  transition: all 0.3s ease;
  border: none;
  border-radius: 0;
  background-color: #fff;
  margin: 10px 5px;
}

.brand-link:hover {
  transform: translateY(-5px);
  border-color: #9d101c;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.brand-link img {
  max-height: 60px;
  max-width: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
}

.brand-link:hover img {
  transform: scale(1.1);
}

/* Brands Carousel Container */
.brands-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 30px 0;
    padding: 0 50px; /* Space for controls */
    box-sizing: border-box;
}

.brands-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.brands-slider::-webkit-scrollbar {
    display: none;
}

.brand-item {
    flex: 0 0 160px; /* Fixed width */
    height: 100px;
}

.brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.brand-link:hover {
    transform: translateY(-3px);
    border-color: #9d101c;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.brand-link img {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
}

/* Carousel Controls - Bootstrap 5 Compatible */
.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: #9d101c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  opacity: 0.8;
  transition: all 0.3s ease;
  z-index: 5;
  padding: 0;
  border: none;
  outline: none;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
  background-color: #7d0d16;
  transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev:focus,
.carousel-control-next:focus {
    outline: 2px solid #9d101c;
    outline-offset: 2px;
}

/* Fixed positioning - no transform tricks */
.carousel-control-prev {
    left: 10px;
}

.carousel-control-next {
    right: 10px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background-size: 60%;
  background-color: #9d101c;
  border-radius: 50%;
  background-position: center;
  filter: none;
}

.carousel-control-prev-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' 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' fill='%23fff' 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");
}

/* Simple Product Name Styling */
.product-name a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

/* Widget products (Top Selling, Featured, On-sale) */
.widget-product a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

/* Product Widget Name Fix */
.product-widget .product-name {
    height: auto;
    min-height: 20px;
    max-height: 36px;
    margin-bottom: 5px;
    line-height: 1.2;
    overflow: hidden;
    position: relative;
    width: 100%;
    clear: both;
    font-size: 20px;
}

.product-widget .product-name a {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
    font-size: 14px;
    letter-spacing: -0.3px;
    text-transform: none;
    max-height: 2.4em;
    word-break: break-word;
    text-decoration: none;
}

/* Ensure product body container properly contains all elements */
.product-body {
    position: relative;
    overflow: hidden;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

/* Fix for product widget in store page */
.product-widget {
    position: relative;
    margin: 0 0 10px;
    overflow: hidden;
}

/* Product price styling */
.product-widget .product-price {
    font-size: 16px;
    margin-top: 5px;
}

/* Badge Styling */
.badge.bg-danger.rounded-pill {
    background-color: #9d101c !important;
}

/* Responsive Design */
@media (max-width: 991px) {
    .brands-carousel {
        padding: 0 45px;
    }
    
    .brand-item {
        flex: 0 0 140px;
    }
}

@media (max-width: 767px) {
    .brands-carousel {
        padding: 0 40px;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 35px;
        height: 35px;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 16px;
        height: 16px;
        
    }
    
    .carousel-control-prev {
        left: 5px;
    }
    
    .carousel-control-next {
        right: 5px;
    }
    
    .brand-item {
        flex: 0 0 120px;
        height: 80px;
    }
    
    /* Product name - 2 lines on mobile */
    .product-body .product-name:not(.widget-product) a {
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
        height: 3rem !important;
    }
    
    /* Widget products - still 1 line on mobile */
    .widget-product a {
        -webkit-line-clamp: 1 !important;
        line-clamp: 1 !important;
        height: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .brands-carousel {
        padding: 0 35px;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 30px;
        height: 30px;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 14px;
        height: 14px;
    }
    
    .brand-item {
        flex: 0 0 100px;
        height: 70px;
    }
    
    .brand-link img {
        max-height: 45px;
    }
}
