/* ═══════════════════════════════════════════════════════════════
   BIRDTOPIA Shop v3 — Enhanced shop styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Shop Toolbar (search + sort) ─── */
.shop-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.shop-search {
  flex: 1;
  min-width: 200px;
}

.shop-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: all var(--duration-fast) var(--ease-out);
  box-sizing: border-box;
}

.shop-search input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.shop-sort select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.shop-sort select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* ─── Skeleton Loading Cards ─── */
.skeleton-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton-image {
  height: 220px;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

.skeleton-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

[data-theme="light"] .skeleton-image::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.04) 50%,
    transparent 100%
  );
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

.skeleton-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

[data-theme="light"] .skeleton-line::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.04) 50%,
    transparent 100%
  );
}

.skeleton-line.title { width: 70%; height: 18px; }
.skeleton-line.price { width: 40%; height: 22px; }
.skeleton-line.desc { width: 100%; }
.skeleton-line.btn { width: 100%; height: 42px; border-radius: var(--radius-sm); }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ─── Mini-Cart Dropdown ─── */
.mini-cart {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-surface);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: right var(--duration-normal) var(--ease-out);
  border-left: 1px solid var(--border-color);
}

.mini-cart.open {
  right: 0;
}

.mini-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.mini-cart-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-cart-close {
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color var(--duration-fast);
}

.mini-cart-close:hover {
  color: var(--text-primary);
}

.mini-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.mini-cart-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.mini-cart-item:last-child {
  border-bottom: none;
}

.mini-cart-item img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.mini-cart-item-info {
  flex: 1;
  min-width: 0;
}

.mini-cart-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-cart-item-price {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.mini-cart-item-remove {
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color var(--duration-fast);
}

.mini-cart-item-remove:hover {
  color: var(--brand-rose);
}

.mini-cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.mini-cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.mini-cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.mini-cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.mini-cart-actions {
  display: flex;
  gap: 0.5rem;
}

.mini-cart-actions a {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--duration-fast) var(--ease-out);
}

.mini-cart-actions .btn-view-cart {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.mini-cart-actions .btn-checkout {
  background: var(--brand-primary);
  color: white;
}

.mini-cart-actions .btn-checkout:hover {
  background: var(--brand-primary-light);
}

/* ─── Quick View Modal ─── */
.quick-view-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quick-view-modal.open {
  display: flex;
}

.quick-view-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.quick-view-content {
  position: relative;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
}

.quick-view-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: none;
  font-size: 1.3rem;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 1;
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-view-close:hover {
  background: var(--bg-elevated);
  transform: scale(1.1);
}

.quick-view-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 600px) {
  .quick-view-body {
    grid-template-columns: 1fr;
  }
}

.quick-view-image {
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 250px;
}

.quick-view-image img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.quick-view-details {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.quick-view-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  background: var(--brand-accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.quick-view-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.quick-view-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-primary);
  margin-bottom: 1rem;
}

.quick-view-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.quick-view-stock {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.quick-view-stock.in-stock { color: #22c55e; }
.quick-view-stock.low-stock { color: #f59e0b; }
.quick-view-stock.out-stock { color: #f43f5e; }

.quick-view-actions {
  display: flex;
  gap: 0.75rem;
}

.quick-view-actions .add-to-cart-btn {
  flex: 1;
}

.quick-view-actions .btn-ghost {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--duration-fast);
}

.quick-view-actions .btn-ghost:hover {
  background: var(--bg-subtle);
}

/* ─── Product Card Clickable ─── */
.product-card {
  cursor: pointer;
  position: relative;
}

.product-card .product-info {
  pointer-events: none;
}

.product-card .add-to-cart-btn {
  pointer-events: auto;
}

/* ─── Stock Badge (enhanced) ─── */
.stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  z-index: 2;
  color: #fff;
}

.stock-badge.out { background: #f43f5e; }
.stock-badge.low { background: #f59e0b; }

/* ─── No Results for Filter ─── */
.no-filter-results {
  text-align: center;
  padding: 3rem 2rem;
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.no-filter-results h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ─── Multi-Step Checkout ─── */
.checkout-wrapper {
  grid-column: 1 / -1;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.checkout-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
}

.checkout-step:not(:last-child)::after {
  content: '→';
  margin-left: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.checkout-step.active {
  color: var(--brand-primary);
}

.checkout-step.done {
  color: #22c55e;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--border-strong);
}

.checkout-step.active .step-num {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.checkout-step.done .step-num {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

.checkout-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}

.checkout-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.checkout-notice {
  background: var(--bg-subtle);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  box-sizing: border-box;
  width: 100%;
  transition: all var(--duration-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.checkout-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.checkout-actions .btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.checkout-actions .btn-primary {
  background: var(--brand-primary);
  color: white;
  border: none;
}

.checkout-actions .btn-primary:hover {
  background: var(--brand-primary-light);
}

.checkout-actions .btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.checkout-actions .btn-ghost:hover {
  background: var(--bg-subtle);
}

.checkout-secure {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Review step */
.review-section {
  margin-bottom: 1.5rem;
}

.review-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-address {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem !important;
  font-size: 0.8rem !important;
  display: inline-block;
  margin-top: 0.25rem;
}

.review-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
}

.review-item-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.review-item-img img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.review-item-noimg {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
}

.review-item-info {
  flex: 1;
  min-width: 0;
}

.review-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.review-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.review-item-total {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.review-totals {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Confirmation step */
.checkout-confirmation {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.confirmation-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.confirmation-order {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.confirmation-total {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.confirmation-id {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.confirmation-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.confirmation-actions .btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.confirmation-actions .btn-primary {
  background: var(--brand-primary);
  color: white;
}

.confirmation-actions .btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .shop-toolbar {
    flex-direction: column;
  }

  .mini-cart {
    width: 100vw;
    right: -100vw;
  }
}
