.brandy-compare-floating-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.brandy-compare-floating-button.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.brandy-compare-floating-button.hide-on-scroll,
.brandy-compare-mobile-bar.hide-on-scroll {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.brandy-compare-drawer-open .brandy-compare-floating-button {
  display: none;
}

/* Hide mobile bar on desktop by default */
.brandy-compare-mobile-bar {
  display: none;
}

.brandy-compare-floating-button__button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background-color: #ffffff;
  color: #122940;
  border-radius: 99px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0px 1px 2px 0px #0000000d;
  transition: all 0.3s ease;
  position: relative;
  min-width: 120px;
  justify-content: center;
}

.brandy-compare-floating-button__button:hover {
  background: #122940;
  color: #ffffff;
  box-shadow: 0px 5px 35px 0px #0000000d;
  transform: translateY(-2px);
}

.brandy-compare-floating-button__button:active {
  transform: translateY(0);
}

.brandy-compare-floating-button__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.brandy-compare-floating-button__content {
  display: flex;
  gap: 2px;
}

.brandy-compare-floating-button__text {
  white-space: nowrap;
  color: inherit;
  font-weight: 500;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.is-loading {
  background: linear-gradient(90deg, #f2f6fb 25%, #e9eef5 50%, #f2f6fb 75%);
  background-size: 200% 100%;
  animation: brandy-skeleton 1.4s ease infinite;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.has-product {
  border: 1px solid #dbe5f1;
  background: #ffffff;
  position: relative;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.has-product:hover {
  border-color: #122940;
}

.brandy-compare-drawer__slot.has-product:hover .brandy-compare-drawer__remove {
  opacity: 1;
  visibility: visible;
}

.brandy-compare-drawer .brandy-compare-drawer__thumb {
  width: 50px;
  height: 60px;
}

.brandy-compare-drawer .brandy-compare-drawer__slot {
  min-height: 80px;
  border: 1px dashed #cfd8e3;
  border-radius: 12px;
  background: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.is-empty {
  background: #ffffff;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.is-empty:hover {
  background: #f8fbff;
  border-color: #122940;
}

/* Drawer for desktop */
.brandy-compare-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  z-index: 9999;
  transition: bottom 0.25s ease;
  pointer-events: none;
  padding: 0 12px 12px;
}

.brandy-compare-drawer.is-open {
  bottom: 0;
  pointer-events: auto;
}

.brandy-compare-drawer .brandy-compare-drawer__inner {
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0px 5px 35px 0px #0000000f;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: stretch;
  position: relative;
}

.brandy-compare-drawer .brandy-compare-drawer__inner-content {
  width: var(--wp--style--global--wide-size, 1500px);
  margin: 0 auto;
  display: flex;
  gap: 16px;
}

.brandy-compare-drawer .brandy-compare-drawer__items {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.is-loading {
  background: linear-gradient(90deg, #f2f6fb 25%, #e9eef5 50%, #f2f6fb 75%);
  background-size: 200% 100%;
  animation: brandy-skeleton 1.4s ease infinite;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.has-product {
  border: 1px solid #dbe5f1;
  background: #ffffff;
  position: relative;
}

.brandy-compare-drawer .brandy-compare-drawer__slot.has-product:hover {
  border-color: #122940;
}

.brandy-compare-drawer .brandy-compare-drawer__product {
  display: grid;
  grid-template-columns: 60px 1fr 24px;
  gap: 10px;
  align-items: center;
  width: 100%;
  position: relative;
}

.brandy-compare-drawer .brandy-compare-drawer__thumb img {
  width: 50px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: #f5f5f5;
}

.brandy-compare-drawer .brandy-compare-drawer__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brandy-compare-drawer .brandy-compare-drawer__title {
  font-weight: 400;
  color: #122940;
  font-size: 12px;
  line-height: 18px;
}

.brandy-compare-drawer .brandy-compare-drawer__price {
  color: #122940;
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
}

.brandy-compare-drawer__remove {
  border: none;
  width: 20px;
  height: 20px;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: -20px;
  right: -20px;
  z-index: 10;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brandy-compare-drawer .brandy-compare-drawer__add {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #122940;
  cursor: pointer;
}

.brandy-compare-drawer .brandy-compare-drawer__add-text {
  font-size: 12px;
  font-weight: 400;
  color: #5a6d80;
}

.brandy-compare-drawer .brandy-compare-drawer__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.brandy-compare-drawer .brandy-compare-drawer__clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #5f6b7a;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
}

.brandy-compare-drawer .brandy-compare-drawer__compare {
  border: none;
  background: #122940;
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(18, 41, 64, 0.15);
  font-size: 14px;
  flex: 1;
}

.brandy-compare-drawer .brandy-compare-drawer__close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: #f8f8f8;
  color: #5a6d80;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.brandy-compare-drawer .brandy-compare-drawer__close:hover {
  background: #f2f2f2;
  color: #122940;
}

.brandy-compare-drawer .brandy-compare-drawer__close[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  right: -30px;
  white-space: nowrap;
  background: #122940;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 5;
}

.brandy-compare-drawer .brandy-compare-drawer__close[data-tooltip]:hover::after,
.brandy-compare-drawer
  .brandy-compare-drawer__close[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

@keyframes brandy-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Mobile Drawer Styles */
@media (max-width: 768px) {
  body.brandy-compare-drawer-open {
    overflow: hidden;
  }

  /* Drawer Backdrop - Full screen overlay behind drawer */
  .brandy-compare-drawer .brandy-compare-drawer__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: auto;
  }

  .brandy-compare-drawer.is-open .brandy-compare-drawer__backdrop {
    opacity: 1;
    visibility: visible;
  }

  /* Mobile Drawer Container */
  .brandy-compare-drawer {
    padding: 0;
    z-index: 10000;
  }

  .brandy-compare-drawer.is-open {
    display: block !important;
    pointer-events: auto;
  }

  /* Mobile Drawer Inner */
  .brandy-compare-drawer .brandy-compare-drawer__inner {
    z-index: 2;
    padding: 20px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  /* Inner Content - Scrollable Area */
  .brandy-compare-drawer .brandy-compare-drawer__inner-content {
    flex-direction: column;
  }

  /* Mobile Drawer Items */
  .brandy-compare-drawer .brandy-compare-drawer__items {
    gap: 16px;
  }

  /* Mobile Bar (Fixed at Bottom of Screen) */
  .brandy-compare-mobile-bar {
    display: flex !important;
    position: fixed;
    border-top-right-radius: 16px;
    border-top-left-radius: 16px;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
  }

  .brandy-compare-mobile-bar__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
  }

  .brandy-compare-mobile-bar__label {
    font-size: 14px;
    color: #122940;
    font-weight: 500;
  }

  .brandy-compare-mobile-bar__count {
    font-size: 14px;
    color: #5a6d80;
    font-weight: 400;
  }

  .brandy-compare-mobile-bar__compare-btn {
    flex: 1;
    max-width: 120px;
    background: #122940;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .brandy-compare-mobile-bar__compare-btn:active {
    background: #f0f0f0;
  }

  .brandy-compare-mobile-bar__toggle-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #122940;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s ease;
  }

  .brandy-compare-mobile-bar__toggle-btn:active {
    background: rgba(255, 255, 255, 0.1);
  }

  /* Hide mobile bar when drawer is open */
  .brandy-compare-drawer-open .brandy-compare-mobile-bar {
    display: none !important;
  }

  .brandy-compare-drawer__remove {
    opacity: 1;
    visibility: visible;
    top: 0;
    right: 0;
  }
}

/* Hide button when count is 0 */
.brandy-compare-floating-button[data-count="0"]
  .brandy-compare-floating-button__badge {
  display: none;
}

/* Responsive design */
@media (max-width: 768px) {
  .brandy-compare-floating-button {
    display: none;
    bottom: 15px;
    right: 15px;
  }

  .brandy-compare-floating-button__button {
    padding: 10px 16px;
    font-size: 13px;
    min-width: 100px;
  }

  .brandy-compare-floating-button__icon {
    width: 18px;
    height: 18px;
  }

  .brandy-compare-floating-button__text {
    display: none;
  }

  .brandy-compare-floating-button__button {
    min-width: 50px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }
}
