/* Topbar Styles */
.kasws-topbar {
  display: flex;
  align-items: center;
  position: relative;
  justify-content: space-between;
  background: linear-gradient(to right, #7d9cf6, #e79ac7);
  padding: 0.5rem 1rem;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-weight: bold;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.2);
  flex-wrap: nowrap; /* Prevent multiple rows */
}

body.has-kasws-topbar {
  padding-top: 3.75rem;
}

/* Adjust for WordPress admin bar */
body.admin-bar .kasws-topbar {
  top: 2rem;
}

/* Sale Badge */
.kasws-sale-badge {
  background: red;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3125rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.kasws-tag-image {
  width: 32px;
  height: 32px;
}

/* Offer Text */
.kasws-offer-text {
  flex-grow: 1;
  text-align: center;
  font-size: 0.9rem;
  margin: 0 0.625rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-wrap: wrap;
}

/* Shop Button */
.kasws-shop-btn {
  background: #ff7800;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.3125rem;
  text-decoration: none;
  font-size: 0.875rem;
  box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.3),
    0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
  border: 0.0625rem solid rgba(255, 255, 255, 0.1);
  transform: translateY(-0.125rem);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 0.5rem;
  margin-right: 1.5rem;
}

.kasws-shop-btn:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.375rem 0.5rem rgba(0, 0, 0, 0.4),
    0 0.25rem 0.375rem rgba(0, 0, 0, 0.3);
  color: white;
  text-decoration: none;
}

/* Close Button */
.kasws-close-btn {
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  background-color: rgba(255, 0, 0, 0.85);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  width: 18px;
  height: 18px;
  font-size: 1rem;
}

/* Close Button Hover */
.kasws-close-btn:hover {
  background-color: #ff0000;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  color: white;
}

.kasws-timer {
  display: flex;
  gap: 0.3125rem;
  margin: 0 0.5rem;
}

.kasws-timer-box {
  background: #382c3c;
  padding: 0.25rem 0.3125rem;
  border-radius: 0.4375rem;
  text-align: center;
  min-width: 3.75rem;
  box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.3),
    0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
  border: 0.0625rem solid rgba(255, 255, 255, 0.1);
  transform: translateY(-0.125rem);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kasws-timer-box:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.375rem 0.5rem rgba(0, 0, 0, 0.4),
    0 0.25rem 0.375rem rgba(0, 0, 0, 0.3);
}

.kasws-timer-box .kasws-digit {
  color: orange;
  /* font-size: 1.25rem; */
  font-weight: bold;
  line-height: 1.2;
}

.kasws-timer-box .kasws-label {
  color: white;
  font-size: 0.625rem;
  display: block;
  margin-top: 0.125rem;
  line-height: 1;
}

@media screen and (max-width: 768px) {
  .kasws-topbar {
    padding: 0.375rem 0.625rem;
  }

  .kasws-sale-badge {
    font-size: 0.625rem;
    padding: 0.1875rem 0.375rem;
    margin-right: 0.3rem;
  }
  .kasws-tag-image {
    width: 28px;
    height: 28px;
  }
  .kasws-offer-text {
    font-size: 0.65rem;
    margin: 0 0.3125rem;
    text-wrap: wrap;
  }

  .kasws-shop-btn {
    font-size: 0.675rem;
    padding: 0.3125rem 0.5rem;
    margin-left: 0.3rem;
    margin-right: 1.2rem;
  }

  .kasws-close-btn {
    width: 16px;
    height: 16px;
    font-size: 0.875rem;
    right: 0.3rem;
  }

  .kasws-timer {
    gap: 0.2rem;
    margin: 0 0.3rem;
  }

  .kasws-timer-box {
    min-width: 2.2rem;
    padding: 0.15rem 0.2rem;
  }

  .kasws-timer-box .kasws-digit {
    font-size: 0.75rem;
  }

  .kasws-timer-box .kasws-label {
    font-size: 0.45rem;
    margin-top: 0.1rem;
  }
}

/* Mobile Phones */
@media screen and (max-width: 576px) {
  .kasws-topbar {
    padding: 0.3125rem 0.375rem;
  }

  .kasws-sale-badge {
    font-size: 0.5625rem;
    padding: 0.125rem 0.25rem;
    margin-right: 0.2rem;
  }
  .kasws-tag-image {
    width: 24px;
    height: 24px;
  }
  .kasws-offer-text {
    font-size: 0.425rem;
    line-height: 1.2;
    margin: 0 0.18rem;
    text-wrap: wrap;
  }

  .kasws-shop-btn {
    margin-right: 1rem;
    font-size: 0.5625rem;
    padding: 0.25rem 0.375rem;
    margin-left: 0.2rem;
  }

  .kasws-close-btn {
    width: 14px;
    height: 14px;
    font-size: 0.75rem;
    right: 0.2rem;
  }

  .kasws-timer {
    gap: 0.1rem;
    margin: 0 0.15rem;
  }

  .kasws-timer-box {
    min-width: 2.2rem;
    padding: 0.1rem 0.1rem;
  }

  .kasws-timer-box .kasws-digit {
    font-size: 0.7rem;
    /* line-height: 1.1; */
  }

  .kasws-timer-box .kasws-label {
    font-size: 0.375rem;
    margin-top: 0.05rem;
  }
}

@media screen and (max-width: 380px) {
  .kasws-topbar {
    padding: 0.25rem 0.25rem;
    flex-wrap: nowrap;
  }

  /* Make the sale badge more compact */
  .kasws-sale-badge {
    font-size: 0.4rem;
    padding: 0.1rem 0.15rem;
    margin-right: 0.125rem;
  }

  /* Further shrink the offer text */
  .kasws-offer-text {
    font-size: 0.375rem;
    margin: 0 0.12rem;
    line-height: 1.1;
    max-width: 28%;
  }

  /* Make shop button smaller */
  .kasws-shop-btn {
    font-size: 0.45rem;
    padding: 0.2rem 0.25rem;
    margin-left: 0.1rem;
    margin-right: 1rem;
  }

  .kasws-close-btn {
    width: 12px;
    height: 12px;
    font-size: 0.625rem;
    right: 0.15rem;
  }

  .kasws-timer {
    gap: 0.05rem;
    margin: 0 0.1rem;
  }

  .kasws-timer-box {
    min-width: 1.8rem;
    /* padding: 0.05rem 0.05rem; */
  }

  .kasws-timer-box .kasws-digit {
    font-size: 0.5rem;
  }

  .kasws-timer-box .kasws-label {
    font-size: 0.3rem;
    margin-top: 0.02rem;
  }
}

/* For extra small devices (below 380px) - conditional display */
@media screen and (max-width: 320px) {
  .kasws-timer {
    display: none;
  }
  .kasws-tag-image {
    width: 20px;
    height: 20px;
  }
  .kasws-offer-text {
    max-width: 45%;
  }

  .kasws-shop-btn {
    margin-left: auto;
    margin-right: 1rem;
  }
}

/* For extremely narrow screens (below 320px) */
@media screen and (max-width: 220px) {
  .kasws-offer-text {
    display: none;
  }

  .kasws-topbar {
    justify-content: space-between;
  }

  .kasws-sale-badge {
    margin-right: 0.3rem;
  }

  .kasws-shop-btn {
    margin-left: 0.3rem;
  }
}

/*****************
Percentage badge styles
******************/
.kasws-percent-badge {
  position: relative;
  left: 5px; /* Adjust based on theme */
  font-size: 12px;
  z-index: 10;
  background-color: #e02f2f;
  color: white;
  padding: 5px 5px;
  border-radius: 3px;
  margin-left: 5px;
}

/* Hide default sale badge when sitewide sale is active */
body.kasws-sale-active {
  /* hide percentage badge on woodmart */
  .onsale.product-label {
    display: none !important;
  }
  /* hide sale badge on divi */
  .onsale {
    display: none !important;
  }
}

/* On Woodmart Quick view button hiding */
body.kasws-sale-active .wd-quick-view-icon,
body.kasws-sale-active .quick-view {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/****************************
Popup Styles Start here.... 
*****************************/
/* Popup Styles */
#kasws-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999998;
}

.kasws-popup-container {
  /* background: #000000; */
  background: linear-gradient(to right, #7d9cf6, #e79ac7);
  color: white;
  text-align: center;
  width: 400px;
  max-width: 90%;
  max-height: 80vh;
  margin-top: 100px;
  padding: 2.5rem 2rem;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kasws-popup-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  transition: all 0.3s ease;
  line-height: 1;
  width: 20px;
  height: 20px;
  text-align: center;
  background-color: rgba(255, 0, 0, 0.8);
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.kasws-popup-close-btn:hover {
  background-color: #ff0000;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.kasws-popup-title {
  margin: 0 0 15px;
  font-size: 42px;
  color: white;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 0 10px rgba(255, 46, 99, 0.6);
  line-height: 1.1;
  transform: scale(1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.kasws-popup-text {
  font-size: 16px;
  margin: 0 0 15px;
  color: rgba(255, 255, 255, 0.9);
}

/* Timer styles */
.kasws-popup-timer {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 10px 5px;
}

.kasws-popup-timer-box {
  background: #382c3c;
  padding: 3px 4px;
  border-radius: 5px;
  border: 0.0625rem solid rgba(255, 255, 255, 0.1);
  text-align: center;
  min-width: 60px;
  display: block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  line-height: 1.5;
  transform: translateY(-0.125rem);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kasws-popup-digit {
  color: orange;
  font-size: 20px;
  font-weight: bold;
}

.kasws-popup-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kasws-popup-timer-box:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.375rem 0.5rem rgba(0, 0, 0, 0.4),
    0 0.25rem 0.375rem rgba(0, 0, 0, 0.3);
}

.kasws-popup-btn {
  display: block;
  background: #ff2e63;
  color: white;
  padding: 10px 8px;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  margin: 18px auto 2px;
  width: 50%;
  text-align: center;
  box-shadow: 0 0.5px 0 #3c3a3a;
  transition: transform 0.4s ease, box-shadow 0.2s ease;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.kasws-popup-btn:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.375rem 0.5rem rgba(0, 0, 0, 0.4),
    0 0.25rem 0.375rem rgba(0, 0, 0, 0.3);
  color: white;
  text-decoration: none;
}

/* Responsive adjustments */

@media (max-width: 480px) {
  .kasws-popup-container {
    padding: 1.8rem 0.8rem;
    width: 65%;
  }

  .kasws-popup-title {
    font-size: 28px;
    margin-bottom: 10px;
  }

  .kasws-popup-text {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .kasws-popup-timer {
    gap: 3px;
  }

  .kasws-popup-timer-box {
    min-width: 35px;
    padding: 1px 2px;
  }

  .kasws-popup-digit {
    font-size: 16px;
  }

  .kasws-popup-label {
    font-size: 6px;
  }

  .kasws-popup-btn {
    padding: 8px 6px;
    font-size: 14px;
    width: auto;
  }
}
