.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.shop-product-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition-speed, 0.2s), box-shadow var(--transition-speed, 0.2s);
}

.shop-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.shop-product-image-wrapper {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-bg-alt, #f5f5f5);
}

.shop-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.shop-product-card:hover .shop-product-image {
  transform: scale(1.05);
}

.shop-product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt, #f5f5f5);
}

.shop-product-info {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-product-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.shop-product-price {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-accent);
}

.shop-product-badge {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.shop-product-badge--oos {
  color: var(--color-error, #dc3545);
}

/* Product detail — Nike-inspired PDP */
.shop-product-detail {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
  max-width: 1200px;
}

.shop-product-detail-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-pdp-hero {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-bg-alt, #f5f5f5);
}

.shop-pdp-hero a {
  display: block;
  width: 100%;
  height: 100%;
}

.shop-pdp-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-pdp-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.shop-pdp-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: var(--color-bg-alt, #f5f5f5);
  transition: border-color 0.15s;
}

.shop-pdp-thumb:hover {
  border-color: var(--color-text-secondary);
}

.shop-pdp-thumb.active {
  border-color: var(--color-accent, #000);
}

.shop-pdp-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-pdp-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.shop-pdp-price {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.shop-product-detail-info {
  padding-top: 8px;
  position: sticky;
  top: 24px;
  align-self: start;
}

/* Product card link */
.shop-product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Product card actions (variant selectors + buy button) */
.shop-product-actions {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shop-product-selector {
  display: flex;
  gap: 10px;
}

.shop-variant-select {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

.shop-qty-select {
  width: 72px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

/* Size chips */
.shop-size-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.shop-size-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.3;
  min-width: 72px;
}

.shop-size-chip:hover {
  border-color: var(--color-accent, #000);
}

.shop-size-chip--selected {
  border-color: var(--color-accent, #000);
  background: var(--color-bg-alt, #f5f5f5);
}

.shop-size-chip--oos {
  opacity: 0.4;
  cursor: default;
  text-decoration: line-through;
}

.shop-size-chip-label {
  font-size: 18px;
  font-weight: 700;
}

.shop-size-chip-stock {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

.shop-buy-btn {
  width: 100%;
  font-size: 18px;
  padding: 16px 24px;
}

/* Cart page */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cart-item {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.cart-item:first-child {
  padding-top: 0;
}

.cart-item-image-link {
  flex-shrink: 0;
}

.cart-item-image {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  background: var(--color-bg-alt, #f5f5f5);
}

.cart-item-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.cart-item-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.cart-item-name:hover {
  text-decoration: underline;
}

.cart-item-size {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.cart-item-price {
  font-size: 16px;
  font-weight: 500;
}

.cart-item-stock-warning {
  font-size: 13px;
  color: var(--color-error, #dc3545);
  font-weight: 500;
  margin-top: 4px;
}

.cart-item-quantity {
  flex-shrink: 0;
}

.cart-quantity-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.cart-quantity-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--color-text);
  transition: background 0.15s;
}

.cart-quantity-btn:hover:not(:disabled) {
  background: var(--color-bg-alt, #f5f5f5);
}

.cart-quantity-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.cart-quantity-value {
  width: 40px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  border: none;
  background: none;
  -moz-appearance: textfield;
}

.cart-quantity-value::-webkit-inner-spin-button,
.cart-quantity-value::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.cart-item-line-total {
  font-size: 18px;
  font-weight: 700;
}

.cart-item-remove {
  font-size: 13px;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.cart-item-remove:hover {
  color: var(--color-error, #dc3545);
}

/* Cart summary */
.cart-summary {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--color-border);
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.cart-summary-warning {
  font-size: 14px;
  color: var(--color-error, #dc3545);
  margin-bottom: 16px;
}

.cart-summary-continue {
  text-align: center;
  margin-top: 16px;
}

.cart-summary-continue a {
  color: var(--color-text-secondary);
  text-decoration: underline;
  font-size: 14px;
}

.cart-checkout-btn {
  width: 100%;
  font-size: 18px;
  padding: 16px 24px;
}

/* Cart empty state */
.cart-empty {
  text-align: center;
  padding: 60px 20px;
}

.cart-empty-title {
  font-size: 20px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 8px;
}

.cart-empty-subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

/* Cart badge */
.cart-badge-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cart-badge-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--color-accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Sidebar cart badge (inline, not absolute-positioned) */
.sidebar-nav-link .cart-badge-count {
  position: static;
  margin-left: auto;
}

/* Cart flash toast */
.cart-flash {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1100;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: cart-flash-in 0.3s ease;
}

.cart-flash--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cart-flash--hiding {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
}

@keyframes cart-flash-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Checkout page */
.checkout-summary {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: white;
  overflow: hidden;
  margin-bottom: 32px;
}

.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
}

.checkout-summary-item:last-of-type {
  border-bottom: none;
}

.checkout-summary-total {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 700;
  background: var(--color-bg-alt, #f9f9f9);
  border-top: 1px solid var(--color-border);
}

.checkout-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkout-field label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.checkout-field-readonly {
  padding: 14px 18px;
  background: var(--color-bg-alt, #f9f9f9);
  border-radius: 12px;
  font-size: 16px;
  color: var(--color-text);
}

/* Sign-in prompt for guests */
.shop-signin-prompt {
  padding: 16px 24px;
  background: var(--color-bg-alt, #f9f9f9);
  border-radius: 12px;
  text-align: center;
  font-size: 15px;
  color: var(--color-text-secondary);
}

.shop-signin-prompt a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.shop-signin-prompt a:hover {
  text-decoration: underline;
}

/* PDP inline cart section */
.pdp-cart-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--color-bg-alt, #f9f9f9);
  border-radius: 14px;
}

.pdp-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pdp-cart-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.pdp-cart-view-link {
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.pdp-cart-view-link:hover {
  text-decoration: underline;
}

.pdp-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}

.pdp-cart-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pdp-cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pdp-cart-item-size {
  font-size: 14px;
  font-weight: 500;
}

.pdp-cart-item-total {
  font-size: 14px;
  font-weight: 700;
}

.pdp-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Shop header cart link */
.shop-header-cart-link {
  text-decoration: none;
  color: inherit;
}

@media (max-width: 768px) {
  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
  }

  .shop-product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .shop-pdp-title {
    font-size: 24px;
  }

  .shop-pdp-hero {
    border-radius: 12px;
  }

  .shop-pdp-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
  }

  .shop-product-detail-info {
    position: static;
  }

  .cart-item {
    flex-wrap: wrap;
    gap: 16px;
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
  }

  .cart-item-actions {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .cart-flash {
    left: 16px;
    right: 16px;
  }
}
