/* === General Layout === */
.sps-wrapper {
  font-family: "Familjen Grotesk", Sans-serif !important;
  max-width: 1700px;
  margin: 0 auto;
  padding: 1rem;
  color: #333;
}

/* === Search bar === */
.sps-search-bar {
  display: flex;
  justify-content: center;
  margin: 2rem auto;
  width: 50%;
  max-width: 600px !important;
  border-radius: 50%;
}

/* === Input field === */
.sps-input {
  width: 100%;
  padding: 12px 25px !important;
  font-size: 16px;
  font-family: Arial, sans-serif;
  color: #2e2e2e;
  background: #fff;
  border: 1px solid rgb(190, 190, 190) !important;
  border-radius: 70px !important; /* Force full rounding */
  outline: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  appearance: none;       /* Removes browser default styling */
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 60px;
}


/* === Product Cards === */
/* === Product List Layout === */
.sps-results {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center;
  gap: 1rem;
  width: 100%;
  flex-wrap: wrap;
}

.sps-card {
  display: flex;
  /* justify-content: center; */
  align-items: center;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: background 0.2s ease;
  margin-bottom: 15px;
  width: 48% !important;
}

.sps-card:hover {
  background: #fafafa;
}

/* Product Image */
.sps-card-img {
  width: 230px !important;
  height: 230px !important; 
  object-fit: contain;
  border-radius: 6px;
  margin-right: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Text content */
.sps-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0.2rem 0;
  margin-top: 13px !important; 
}
.sps-desc {
  font-size: 0.9rem;
  color: #555;
  margin: 0.2rem 0;
}
.sps-price {
  font-weight: bold;
  margin: 0.4rem 0;
}
.sps-enquire-btn {
  background: #fff;
  border: 1px solid #c2185b;
  color: #c2185b;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sps-enquire-btn:hover {
  background: #c2185b;
  color: #fff;
}

/* === Product Modal === */
.sps-product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  background: rgba(0,0,0,0.6);
  overflow: auto;
}
.sps-product-modal.sps-open {
  display: flex;
}

.sps-product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.sps-product-box {
  position: relative;
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px !important;
  width: 600px !important;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideIn 0.2s ease;
}

/* Modal Close Button */
.sps-product-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #888;
}
.sps-product-close:hover {
  color: #333;
}

/* Product Content */
#sps-prod-img {
  width: 100%;
  max-height: 350px !important;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 1rem;
}


#sps-prod-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.6rem;
}

#sps-prod-desc {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1rem;
}

#sps-prod-enquire {
  background: #fff;
  border: 1px solid #c2185b !important;
  color: #c2185b;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#sps-prod-enquire:hover {
  background: #c2185b;
  color: #fff;
}

/* === Animation === */
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === Enquiry Modal === */
/* === Enquiry Modal === */
.sps-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(0,0,0,0.6); /* move overlay bg here */
}

.sps-modal.sps-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* remove flex + bg from overlay */
.sps-modal-overlay {
  position: absolute;
  inset: 0;
  background: transparent; /* keep transparent, bg is on .sps-modal now */
}

.sps-modal-box {
  position: relative;
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px !important;
  width: 90% !important;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 10000; /* ensure above overlay */
}

.sps-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #888;
}
.sps-modal-close:hover {
  color: #333;
}

/* === Modal Content === */
.sps-product-search {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  font-size: 1rem;
}
.sps-suggestions {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  max-height: 160px;
  overflow-y: auto;
}
.sps-suggestion {
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}
.sps-suggestion:hover {
  background: #f5f5f5;
}

/* === Selected Products (Chips) === */
.sps-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.sps-tag {
  background: #f1f1f1;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}
.sps-tag-remove {
  background: transparent;
  border: none;
  margin-left: 0.4rem;
  font-size: 1rem;
  cursor: pointer;
  color: #c2185b;
}
.sps-tag-remove:hover {
  color: #000;
}

/* === Enquiry Form === */
#sps-enquiry-form label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  font-weight: bold;
}
#sps-enquiry-form input,
#sps-enquiry-form textarea {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
#sps-enquiry-form textarea {
  min-height: 80px;
  resize: vertical;
}
#sps-enquiry-form button[type="submit"] {
  background: #2e7d32;
  color: #fff;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s ease;
}
#sps-enquiry-form button[type="submit"]:hover {
  background: #1b5e20;
}

/* === Form Status Messages === */
.sps-form-status {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  display: none;
}
.sps-form-status.sps-success {
  color: #00b209;
  display: block;
}
.sps-form-status.sps-error {
  color: #c2185b;
  display: block;
}

/* === Responsive Adjustments === */
@media (max-width: 600px) {
  .sps-product-box, .sps-modal-box {
    width: 95%;
    padding: 1.5rem;
  }
  .sps-product-img {
    max-height: 200px;
  }
}

.sps-card.skeleton {
  background: #f4f4f4;
  border-radius: 8px;
  overflow: hidden;
  animation: pulse 1.2s infinite;
}
.sps-card.skeleton .sps-card-img,
.sps-card.skeleton .sps-title,
.sps-card.skeleton .sps-desc,
.sps-card.skeleton .sps-price,
.sps-card.skeleton .sps-btn {
  background: #e0e0e0;
  border-radius: 4px;
  height: 16px;
  margin: 6px 05px;
}
.sps-card.skeleton .sps-card-img { height: 120px; }
.sps-card.skeleton .sps-title { width: 60%; height: 20px; }
.sps-card.skeleton .sps-desc { width: 100%; }
.sps-card.skeleton .sps-price { width: 40%; height: 18px; }
.sps-card.skeleton .sps-btn { width: 70px; height: 28px; border-radius: 14px; }

@keyframes pulse {
  0% { opacity: .6; }
  50% { opacity: 1; }
  100% { opacity: .6; }
}

/* === Slide-in Animation for Products === */
@keyframes slideUpFade {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Apply animation to each product card */
.sps-card {
  display: flex;
  align-items: flex-start;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: background 0.2s ease;
  margin-bottom: 15px;

  /* NEW: animation */
  opacity: 0;
  transform: translateY(30px);
  animation: slideUpFade 0.5s ease forwards;
}

/* Add stagger effect: each card comes with slight delay */
.sps-card:nth-child(1) { animation-delay: 0.1s; }
.sps-card:nth-child(2) { animation-delay: 0.2s; }
.sps-card:nth-child(3) { animation-delay: 0.3s; }
.sps-card:nth-child(4) { animation-delay: 0.4s; }
.sps-card:nth-child(5) { animation-delay: 0.5s; }
/* extend as needed for more products */



/* === Responsive: Switch to card/grid layout on mobile === */
/* === Responsive: Switch to card/grid layout on mobile === */
@media (max-width: 600px) {
  .sps-results {
    display: flex !important;
    flex-direction: column;
    /* grid-template-columns: repeat(1, 1fr); /* 1 card per row */
    gap: 1rem;
    justify-content: center !important;
    align-items: center;
    width: 100%;
    padding: -10px !important;
  }

  .sps-card {
    flex-direction: column;   /* stack image + text vertically */
    align-items: center;
    padding: 0.8rem;
  }

  .sps-card-img {
    width: 100%;
    height: 180px;
    margin: 0 0 0.8rem 0;
  }

  .sps-title {
    font-size: 1rem;
  }
  .sps-desc {
    font-size: 0.85rem;
  }
  .sps-price {
    font-size: 0.9rem;
  }

  .sps-enquire-btn {
    width: 100%; /* button full width in mobile */
    margin-top: 0.6rem;
  }

 .sps-card.skeleton {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem;
    border-radius: 8px;
    background: #f4f4f4;
    animation: pulse 1.2s infinite;
  }

  .sps-card.skeleton .sps-card-img {
    width: 100%;
    height: 180px;
    border-radius: 6px;
    margin-bottom: 0.8rem;
    background: #e0e0e0;
  }

  .sps-card.skeleton .sps-title {
    width: 60px;
    height: 18px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 0.4rem 0;
  }

  .sps-card.skeleton .sps-desc {
    width: 95px;
    height: 14px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 0.3rem 0;
  }

  .sps-card.skeleton .sps-price {
    width: 45px;
    height: 16px;
    background: #e0e0e0;
    border-radius: 4px;
    margin: 0.5rem 0;
  }

  .sps-card.skeleton .sps-btn {
    width: 100%;
    height: 36px;
    border-radius: 6px;
    background: #e0e0e0;
    margin-top: 0.6rem;
  }
}


.sps-input::placeholder {
  color: #999;
  opacity: 0.8;
  transition: opacity 0.3s ease, color 0.3s ease;
  font-style: italic;
}
.sps-input:focus::placeholder {
  opacity: 0.4;
  color: #555;
}

/* === Refined Fix: Keep Popup Centered and Prevent Stretch === */
.sps-modal,
.sps-product-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  position: fixed;
  inset: 0;
  z-index: 99999;
}

/* Keep popup boxed, no stretch */
.sps-modal-box,
.sps-product-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 2rem;
  width: auto;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 0 auto;
  display: block;
}



/* prevent elementor from forcing 100% width/height */
.sps-modal-box *,
.sps-product-box * {
  max-width: 100%;
  flex: none !important;
}

/* mobile-friendly modal */
@media (max-width: 600px) {
  .sps-modal-box,
  .sps-product-box {
    width: 90%;
    max-width: 90%;
    padding: 1.5rem;
  }
}
 

/* === Elementor Override Isolation Fix === */
.elementor-widget-container .sps-modal-box,
.elementor-widget-container .sps-product-box,
.elementor-section .sps-modal-box,
.elementor-section .sps-product-box {
  all: unset;
  position: relative !important;
  background: #fff !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
  padding: 2rem !important;
  width: auto !important;
  max-width: 500px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  margin: 0 auto !important;
  display: block !important;
}

/* keep modal container fixed + centered */
.elementor-widget-container .sps-modal,
.elementor-widget-container .sps-product-modal,
.elementor-section .sps-modal,
.elementor-section .sps-product-modal {
  all: unset;
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.6) !important;
  z-index: 999999 !important;
}

/* reset any flex inheritance inside modal */
.elementor-widget-container .sps-modal-box *,
.elementor-widget-container .sps-product-box *,
.elementor-section .sps-modal-box *,
.elementor-section .sps-product-box * {
  flex: none !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}



/* === Additional Responsive Enhancements === */

/* --- Tablet View (601px–1024px) --- */
@media (min-width: 601px) and (max-width: 1024px) {
  .sps-search-bar {
    width: 80% !important;
  }

  .sps-results {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    justify-items: center;
    width: 100%;
  }

  .sps-card {
    flex-direction: column;
    align-items: center;
    width: 100% !important;
  }

  .sps-card-img {
    width: 200px;
    height: 200px;
    margin-bottom: 1rem;
    margin: auto !important;

    
  }

  .sps-title {
    font-size: 1.05rem;
    text-align: center;
  }

  .sps-desc {
    font-size: 0.9rem;
    text-align: center;
  }

  .sps-enquire-btn {
    /* width: 100%; */
    margin-top: 0.8rem;
    position: relative;
    bottom: 10px;
  }

  /* Center popup and adjust padding */
  .sps-product-box,
  .sps-modal-box {
    width: 80% !important;
    max-width: 80% !important;
    padding: 1.8rem !important;
  }
}

/* --- Mobile View (≤600px) --- */
@media (max-width: 600px) {
  .sps-search-bar {
    font-size: 16px;
    width: 96% !important;
    flex-direction: column;
  }

  .sps-input{
    font-size: 14px;
  }

  .sps-results {
    display: flex !important;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
  }

  .sps-card {
    flex-direction: column;
    align-items: center;
    
    width: 90% !important;
    padding: 1rem;
  }

  .sps-card-img {
    width: 100%;
    height: 180px;
    margin-bottom: 0.8rem;
  }

  .sps-title {
    font-size: 1rem;
  }

  .sps-desc {
    font-size: 0.85rem;
  }

  .sps-enquire-btn {
    width: 100%;
    font-size: 0.9rem;
    margin-top: 0.6rem;
  }

  .sps-card.skeleton .sps-card-img {
    width: 100% !important;        /* full width image */
    height: 200px !important;
    margin: 0 auto 1rem auto;      /* center horizontally */
    display: block;
    object-fit: contain;
    background: #e0e0e0;
    border-radius: 6px;
  }

  /* Modals stay readable */
  .sps-modal-box,
  .sps-product-box {
    width: 90% !important;
    max-width: 90% !important;
    padding: 1.2rem !important;
  }
}

/* --- Small Mobile View (≤400px) --- */
@media (max-width: 400px) {
  .sps-card-img {
    height: 160px;
  }

  .sps-title {
    font-size: 0.95rem;
  }

  .sps-desc {
    font-size: 0.8rem;
  }

  .sps-enquire-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
}
/* === Tablet Skeleton Card Alignment Fix === */
@media (min-width: 601px) and (max-width: 1024px) {
  .sps-card.skeleton {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* align content to flex-start */
    justify-content: flex-start;
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    background: #f4f4f4;
    animation: pulse 1.2s infinite;
  }

  .sps-card.skeleton .sps-card-img {
    width: 100% !important;        /* full width image */
    height: 200px !important;
    margin: 0 auto 1rem auto;      /* center horizontally */
    display: block;
    object-fit: contain;
    background: #e0e0e0;
    border-radius: 6px;
  }

  .sps-card.skeleton .sps-title,
  .sps-card.skeleton .sps-desc,
  .sps-card.skeleton .sps-price,
  .sps-card.skeleton .sps-btn {
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 0.6rem;
  }

  .sps-card.skeleton .sps-title { width: 60%; height: 20px; }
  .sps-card.skeleton .sps-desc { width: 90%; height: 14px; }
  .sps-card.skeleton .sps-price { width: 40%; height: 16px; }
  .sps-card.skeleton .sps-btn { width: 80px; height: 30px; border-radius: 15px; }
}


/* === Product Category Tag === */
.sps-card {
  position: relative; /* anchor for tag */
}

.sps-cat-tag {
  position: absolute;
  top: 10px;
  margin-bottom: 10px;
  right: 10px;
  /* WP blue */
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: capitalize;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  z-index: 5;
}

.sps-card:hover .sps-cat-tag {
  background: #2564eb; /* darker on hover */
}

@media (max-width: 600px) {
  .sps-cat-tag {
    top: 8px;
    right: 8px;
    font-size: 11px;
    padding: 3px 8px;
  }
}

/* Product category tag adjustment */
.sps-card {
  position: relative;
  overflow: hidden;
}

.sps-card-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* move tag into image zone, not overlapping text */
.sps-cat-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #2564ebe0; /* blue */
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 10px;
  text-transform: capitalize;
  z-index: 2;
}

.sps-card-body {
  margin-top: 10px; /* spacing after image */
}

