/* =============================================
   QUICK BUY — Button
   ============================================= */

.grid__item {
  position: relative;
}

.quick-buy-trigger {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: #ff026d;
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0 0 4px 4px;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  z-index: 10;
}

.quick-buy-trigger:hover {
  background: rgba(0, 0, 0, 1);
}

/* Desktop: hide by default, reveal on card hover */
@media (min-width: 750px) {
  .quick-buy-trigger {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    opacity: 0;
    transform: translateY(4px);
    border-radius: 0 0 4px 4px;
  }

  .grid__item:hover .quick-buy-trigger {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile: always visible, static flow */
@media (max-width: 749px) {
  .quick-buy-trigger {
    margin-top: 8px;
    border-radius: 4px;
  }
}


/* =============================================
   QUICK BUY — Modal Overlay
   ============================================= */

.qb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (min-width: 750px) {
  .qb-overlay {
    align-items: center;
  }
}

.qb-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}


/* =============================================
   QUICK BUY — Modal Dialog
   ============================================= */

.qb-modal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 28px 24px 32px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@media (min-width: 750px) {
  .qb-modal {
    border-radius: 12px;
    transform: scale(0.96) translateY(10px);
  }
}

.qb-overlay.is-open .qb-modal {
  transform: translateY(0);
}

@media (min-width: 750px) {
  .qb-overlay.is-open .qb-modal {
    transform: scale(1) translateY(0);
  }
}

/* Drag handle (mobile sheet feel) */
.qb-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 20px;
  display: block;
}

@media (min-width: 750px) {
  .qb-handle { display: none; }
}

/* Close button */
.qb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f4f4f4;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.qb-close:hover {
  background: #e8e8e8;
}


/* =============================================
   QUICK BUY — Product Header
   ============================================= */

.qb-product-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.qb-product-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f5f5f5;
}

.qb-product-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.35;
  padding-right: 28px;
}

.qb-product-price {
  font-size: 15px;
  font-weight: 500;
  color: #111;
}

.qb-compare-price {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
  margin-right: 6px;
  font-weight: 400;
}

.qb-sale-price {
  color: #c0392b;
}

/* Divider */
.qb-divider {
  height: 1px;
  background: #eee;
  margin: 16px 0;
}


/* =============================================
   QUICK BUY — Option Groups (Pill / Swatch)
   ============================================= */

.qb-option-group {
  margin-bottom: 18px;
}

.qb-option-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.qb-option-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #111;
}

.qb-option-selected {
  font-size: 12px;
  color: #777;
  font-weight: 400;
}

.qb-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qb-pill {
  padding: 8px 16px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
  position: relative;
  line-height: 1;
  color: #222;
  user-select: none;
}

.qb-pill:hover:not(.is-disabled):not(.is-selected) {
  border-color: #999;
  background: #fafafa;
}

.qb-pill.is-selected {
  border-color: #111;
  background: #111;
  color: #fff;
}

/* Unavailable variant — strikethrough diagonal */
.qb-pill.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  overflow: hidden;
}

.qb-pill.is-disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 0.5px),
    #bbb calc(50% - 0.5px),
    #bbb calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
  pointer-events: none;
}


/* =============================================
   QUICK BUY — Unavailable Notice
   ============================================= */

.qb-unavailable {
  font-size: 13px;
  color: #c0392b;
  margin-top: -8px;
  margin-bottom: 8px;
}


/* =============================================
   QUICK BUY — Action Buttons
   ============================================= */

.qb-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.qb-btn {
  flex: 1;
  padding: 15px 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid #ff026d;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  text-align: center;
}

.qb-btn-cart {
  background: #fff;
  color: #111;
}

.qb-btn-cart:hover:not(:disabled) {
  background: #f5f5f5;
}

.qb-btn-buynow {
  background: #ff026d;
  color: #fff;
}

.qb-btn-buynow:hover:not(:disabled) {
  background: #333;
  border-color: #333;
}

.qb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


/* =============================================
   QUICK BUY — Status Message
   ============================================= */

.qb-status {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
  transition: opacity 0.2s;
}

.qb-status.success { color: #1a7a3a; }
.qb-status.error   { color: #c0392b; }


/* =============================================
   QUICK BUY — Loading Skeleton
   ============================================= */

.qb-loading {
  padding: 32px 0;
  text-align: center;
  color: #999;
  font-size: 14px;
}

@keyframes qb-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.qb-loading::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid #eee;
  border-top-color: #999;
  border-radius: 50%;
  animation: qb-spin 0.7s linear infinite;
}

@keyframes qb-spin {
  to { transform: rotate(360deg); }
}
