/* Mira cart drawer + product buy button */

.mira-storefront .mira-product-buy {
  margin-top: 1rem;
}

.mira-storefront .mira-product-buy__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 1.1rem 1.5rem;
  border: 0;
  border-radius: 7px;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mira-storefront .mira-product-buy__button:hover:not(:disabled) {
  opacity: 0.92;
}

.mira-storefront .mira-product-buy__button:disabled,
.mira-storefront .mira-product-buy__button--disabled {
  background: #888;
  cursor: not-allowed;
}

.mira-storefront .mira-product-buy-form__variants {
  margin-bottom: 1rem;
}

/* Popup shell */
.mira-storefront .mira-cart-popup__layer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mira-storefront .mira-cart-popup__layer.is-open {
  opacity: 1;
}

.mira-storefront .mira-cart-popup__panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 50vw;
  max-width: 480px;
  min-width: 320px;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 1201;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  opacity: 1;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.mira-storefront .mira-cart-popup__panel.is-open {
  transform: translateX(0);
}

body.mira-cart-popup-open {
  overflow: hidden;
}

.mira-storefront .mira-cart-popup__header {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  background: linear-gradient(135deg, #eb998a, #ffc079);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}

.mira-storefront .mira-cart-popup__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mira-storefront .mira-cart-popup__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mira-storefront .mira-cart-popup__title {
  margin: 0 auto;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mira-storefront .mira-cart-popup__content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.mira-storefront .mira-cart-popup__empty {
  margin: 0;
  color: #666;
  text-align: center;
  padding: 2rem 1rem;
}

.mira-storefront .mira-cart-popup__footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  border-top: 1px solid #eee;
  background: #fff;
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex-shrink: 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}

.mira-storefront .mira-cart-popup__guarantee {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(235, 153, 138, 0.1), rgba(255, 192, 121, 0.16));
  border: 1px solid rgba(235, 153, 138, 0.22);
  box-shadow: 0 2px 8px rgba(235, 153, 138, 0.08);
}

.mira-storefront .mira-cart-popup__guarantee-icon {
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #eb998a, #ffc079);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 3px 10px rgba(235, 153, 138, 0.35);
}

.mira-storefront .mira-cart-popup__guarantee-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.mira-storefront .mira-cart-popup__guarantee-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #3d3d3d;
  line-height: 1.25;
}

.mira-storefront .mira-cart-popup__guarantee-text span {
  font-size: 0.76rem;
  color: #888;
  line-height: 1.3;
}

.mira-storefront .mira-cart-popup__checkout {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #eb998a, #ffc079);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mira-storefront .mira-cart-popup__checkout:hover {
  box-shadow: 0 4px 8px rgba(235, 153, 138, 0.25);
  transform: translateY(-2px);
}

/* Line items */
.mira-storefront .mira-cart-popup__line-items {
  display: flex;
  flex-direction: column;
}

.mira-storefront .mira-cart-popup__line-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.mira-storefront .mira-cart-popup__line-item:hover {
  background: #fafafa;
}

.mira-storefront .mira-cart-popup__line-item-image {
  width: 80px;
  flex-shrink: 0;
}

.mira-storefront .mira-cart-popup__line-item-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mira-storefront .mira-cart-popup__line-item-details {
  flex: 1;
  min-width: 0;
}

.mira-storefront .mira-cart-popup__line-item-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

.mira-storefront .mira-cart-popup__line-item-name a {
  color: #333;
  text-decoration: none;
}

.mira-storefront .mira-cart-popup__line-item-name a:hover {
  color: #eb998a;
}

.mira-storefront .mira-cart-popup__line-item-options,
.mira-storefront .mira-cart-popup__line-item-stock {
  margin: 0;
  font-size: 0.875rem;
  color: #666;
}

.mira-storefront .mira-cart-popup__line-item-stock {
  color: #e53935;
  font-weight: 500;
}

.mira-storefront .mira-cart-popup__line-item-price {
  font-weight: 600;
  color: #333;
  width: 5rem;
  text-align: right;
  flex-shrink: 0;
}

.mira-storefront .mira-cart-popup__line-item-quantity {
  display: flex;
  align-items: center;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  width: 6.9rem;
  flex-shrink: 0;
}

.mira-storefront .mira-cart-popup__quantity-btn {
  background: #fff;
  border: 0;
  height: 2.25rem;
  width: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
}

.mira-storefront .mira-cart-popup__quantity-btn:hover {
  background: #f5f5f5;
  color: #eb998a;
}

.mira-storefront .mira-cart-popup__quantity-input {
  border: 0;
  width: 2.4rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0;
  background: transparent;
  -moz-appearance: textfield;
}

.mira-storefront .mira-cart-popup__quantity-input::-webkit-outer-spin-button,
.mira-storefront .mira-cart-popup__quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (max-width: 768px) {
  .mira-storefront .mira-cart-popup__panel {
    top: 8px;
    right: 2%;
    bottom: 8px;
    left: 2%;
    width: auto;
    max-width: none;
    min-width: 0;
    height: auto;
    border-radius: 12px;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  }

  .mira-storefront .mira-cart-popup__panel.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .mira-storefront .mira-cart-popup__line-item {
    flex-wrap: wrap;
  }

  .mira-storefront .mira-cart-popup__line-item-details {
    width: calc(100% - 96px);
  }

  .mira-storefront .mira-cart-popup__line-item-price,
  .mira-storefront .mira-cart-popup__line-item-quantity {
    margin-top: 0.5rem;
    margin-left: 96px;
  }

  .mira-storefront .mira-cart-popup__line-item-price {
    text-align: left;
    width: auto;
    flex: 1;
  }

  .mira-storefront .mira-cart-popup__checkout {
    background: #000;
    border-radius: 7px;
    padding: 1rem;
  }

  .mira-storefront .mira-cart-popup__checkout:hover {
    transform: none;
    box-shadow: none;
    opacity: 0.92;
  }
}
