/* =============================================================================
   RookiDroid theme — Product cards and shortcode grids (used site-wide)
   ============================================================================= */

/* ── Wrapper ────────────────────────────────────────────────────────────────── */
.rd-products-wrap {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--rd-font-body);
  color: var(--rd-text);
  -webkit-font-smoothing: antialiased;
}
.rd-products-wrap *,
.rd-products-wrap *::before,
.rd-products-wrap *::after {
  box-sizing: border-box;
}

/* ── Section Header ─────────────────────────────────────────────────────────── */
.rd-section__header {
  text-align: center;
  margin-bottom: 40px;
}
.rd-section__tag {
  display: inline-block;
  font-family: var(--rd-font-mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--rd-primary);
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 4px solid var(--rd-yellow);
}
.rd-section__title {
  font-family: var(--rd-font-display);
  letter-spacing: -0.01em;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--rd-text);
  margin: 0 0 12px;
  line-height: 1.2;
}
.rd-section__subtitle {
  font-size: 1rem;
  color: var(--rd-text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.rd-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.rd-tab-btn {
  font-family: var(--rd-font-body);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 9px 22px;
  border-radius: 0;
  border: 2px solid var(--rd-navy);
  background: var(--rd-surface);
  color: var(--rd-text-secondary);
  cursor: pointer;
  clip-path: var(--rd-chamfer-clip);
  transition: var(--rd-transition);
  line-height: 1;
  white-space: nowrap;
}
.rd-tab-btn:hover {
  border-color: var(--rd-navy);
  color: var(--rd-text);
  background: var(--rd-surface-alt);
  transform: translate(-1px, -1px);
}
.rd-tab-btn--active,
.rd-tab-btn[aria-selected="true"] {
  background: var(--rd-primary);
  color: #fff;
  border-color: var(--rd-outline);
}
.rd-tab-btn--active:hover,
.rd-tab-btn[aria-selected="true"]:hover {
  background: var(--rd-primary-dark);
  border-color: var(--rd-outline);
  color: #fff;
}
.rd-tab-panel[hidden] {
  display: none;
}

/* ── Product Grid ───────────────────────────────────────────────────────────── */
.rd-product-grid {
  display: grid;
  gap: 24px;
}
.rd-cols-1 { grid-template-columns: repeat(1, 1fr); }
.rd-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rd-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rd-cols-4 { grid-template-columns: repeat(4, 1fr); }
.rd-cols-5 { grid-template-columns: repeat(5, 1fr); }
.rd-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* ── Product Card ───────────────────────────────────────────────────────────── */
.rd-product-card {
  position: relative;
  background: var(--rd-surface);
  border: 2px solid var(--rd-navy);
  border-radius: 0;
  box-shadow: var(--rd-shadow-hard);
  overflow: hidden;
  transition: transform var(--rd-transition),
              border-color var(--rd-transition),
              box-shadow var(--rd-transition);
  display: flex;
  flex-direction: column;
}
.rd-product-card:hover {
  border-color: var(--rd-primary);
  box-shadow: var(--rd-shadow-hover);
  transform: translate(-2px, -2px);
}

/* Badges */
.rd-card__badges {
  position: absolute;
  top: 14px;
  left: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.rd-badge {
  --rd-chamfer: 4px;
  display: inline-block;
  font-family: var(--rd-font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 3px 9px;
  border-radius: 0;
  border: 1px solid var(--rd-outline);
  clip-path: var(--rd-chamfer-clip);
  line-height: 1.4;
}
.rd-badge--sale { background: var(--rd-danger);   color: #fff; }
.rd-badge--free { background: var(--rd-success);  color: #fff; }
.rd-badge--new  { background: var(--rd-primary);  color: #fff; }
.rd-badge--oos  { background: var(--rd-text-muted); color: #fff; }

/* Image area */
.rd-card__image {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--rd-surface-alt);
  border-bottom: 2px solid var(--rd-navy);
  text-decoration: none;
}
.rd-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--rd-transition);
}
.rd-product-card:hover .rd-card__img {
  transform: scale(1.04);
}
.rd-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  opacity: .2;
  color: var(--rd-primary);
}

/* Hover overlay */
.rd-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(156, 39, 176, .06);
  backdrop-filter: blur(1px);
  opacity: 0;
  transition: opacity var(--rd-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rd-product-card:hover .rd-card__overlay {
  opacity: 1;
}

/* Card body */
.rd-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.rd-card__category {
  font-family: var(--rd-font-mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--rd-primary);
  margin-bottom: 5px;
}
.rd-card__title {
  font-family: var(--rd-font-body);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.4;
  margin: 0 0 10px;
  color: var(--rd-text);
}
.rd-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--rd-transition);
}
.rd-card__title a:hover {
  color: var(--rd-primary);
}
.rd-card__price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.rd-card__price-current {
  font-family: var(--rd-font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--rd-primary);
}
/* WooCommerce outputs <span class="woocommerce-Price-amount"> inside price */
.rd-card__price-current .woocommerce-Price-amount,
.rd-card__price-current bdi {
  font-family: var(--rd-font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--rd-primary);
}
.rd-card__price-original {
  font-family: var(--rd-font-mono);
  font-size: .85rem;
  color: var(--rd-text-muted);
  text-decoration: line-through;
}
.rd-card__price-original .woocommerce-Price-amount,
.rd-card__price-original bdi {
  color: inherit;
  font-size: inherit;
}
.rd-card__action {
  width: 100%;
  margin-top: auto;
  justify-content: center;
  text-align: center;
}

/* ── Buttons ──────────────────────────────────────────────────────────────────
   Machine controls: heavy outline, chamfered mecha corners, lifting on hover
   and pressing back on click. The clip cuts off any box-shadow, so these
   have none. */
.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--rd-font-body);
  font-weight: 700;
  letter-spacing: .03em;
  font-size: .9rem;
  padding: 12px 24px;
  border-radius: 0;
  border: 2px solid transparent;
  box-shadow: none;
  clip-path: var(--rd-chamfer-clip);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--rd-transition),
              color var(--rd-transition),
              border-color var(--rd-transition),
              transform var(--rd-transition),
              filter var(--rd-transition);
  white-space: nowrap;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}
.rd-btn:hover {
  transform: translate(-1px, -1px);
  filter: brightness(1.08);
}
.rd-btn:active {
  transform: translate(1px, 1px);
  filter: none;
}
.rd-btn--primary {
  background: var(--rd-primary);
  color: #fff;
  border-color: var(--rd-outline);
}
.rd-btn--primary:hover {
  background: var(--rd-primary-dark);
  border-color: var(--rd-outline);
  color: #fff;
  text-decoration: none;
}
.rd-btn--primary:active {
  background: var(--rd-primary-active);
}
.rd-btn--outline {
  background: var(--rd-surface);
  color: var(--rd-text);
  border-color: var(--rd-navy);
}
.rd-btn--outline:hover {
  background: var(--rd-surface-alt);
  color: var(--rd-primary) !important;
  border: 2px solid var(--rd-navy) !important;
  text-decoration: none;
}
.rd-btn--disabled,
.rd-btn--disabled:hover {
  background: var(--rd-surface-alt);
  color: var(--rd-text-muted);
  border-color: var(--rd-border);
  cursor: not-allowed;
  opacity: .75;
  transform: none;
  filter: none;
}
.rd-btn--sm {
  font-size: .82rem;
  padding: 8px 16px;
}

/* Button loading / added state */
.rd-add-to-cart.rd-loading {
  opacity: .7;
  pointer-events: none;
  cursor: wait;
}
.rd-add-to-cart.rd-added {
  background: var(--rd-success);
  border-color: var(--rd-outline);
  color: #fff;
}
.rd-add-to-cart.rd-added:hover {
  background: var(--rd-success);
  border-color: var(--rd-outline);
  transform: none;
}

/* ── View All ───────────────────────────────────────────────────────────────── */
.rd-view-all {
  text-align: center;
  margin-top: 36px;
}

/* ── Toast error notice ─────────────────────────────────────────────────────── */
.rd-cart-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--rd-danger);
  color: #fff;
  font-family: var(--rd-font-mono);
  font-size: .88rem;
  font-weight: 600;
  padding: 12px 20px;
  border: 2px solid var(--rd-outline);
  border-radius: 0;
  box-shadow: var(--rd-shadow-md);
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.rd-cart-notice--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.rd-no-products {
  text-align: center;
  color: var(--rd-text-muted);
  font-size: .95rem;
  padding: 40px 0;
  width: 100%;
}

/* ── Shop page grid shortcode ────────────────────────────────────────────── */
.rd-shop-grid {
  width: 100%;
  display: grid;
  gap: 18px;
}
.rd-shop-grid .rd-shop-grid-placeholder {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: .25;
  color: var(--rd-primary);
}
.rd-shop-grid--cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.rd-shop-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rd-shop-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rd-shop-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* product-card — scoped so these never conflict with WooCommerce */
.rd-shop-grid .product-card {
  background: var(--rd-surface);
  border: 2px solid var(--rd-navy);
  border-radius: 0;
  box-shadow: var(--rd-shadow-hard);
  overflow: hidden;
  transition: transform var(--rd-transition),
              border-color var(--rd-transition),
              box-shadow var(--rd-transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.rd-shop-grid .product-card:hover {
  border-color: var(--rd-primary);
  box-shadow: var(--rd-shadow-hover);
  transform: translate(-2px, -2px);
}
.rd-shop-grid .product-card__badges {
  position: absolute;
  top: 14px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.rd-shop-grid .product-card__image {
  display: block;
  aspect-ratio: 1;
  background: var(--rd-surface-alt);
  border-bottom: 2px solid var(--rd-navy);
  overflow: hidden;
  position: relative;
  text-decoration: none;
}
.rd-shop-grid .product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.rd-shop-grid .product-card:hover .product-card__image img {
  transform: scale(1.04);
}
.rd-shop-grid .product-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.rd-shop-grid .product-card__category {
  font-family: var(--rd-font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--rd-primary);
  margin-bottom: 6px;
}
.rd-shop-grid .product-card__title {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.4;
  margin: 0 0 10px;
  color: var(--rd-text);
  min-height: 42px;
}
.rd-shop-grid .product-card__price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.rd-shop-grid .product-card__price-current {
  font-family: var(--rd-font-mono);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--rd-primary);
}
.rd-shop-grid .product-card__price-current .woocommerce-Price-amount,
.rd-shop-grid .product-card__price-current bdi {
  font-family: var(--rd-font-mono);
  font-weight: 700;
  color: var(--rd-primary);
}
.rd-shop-grid .product-card__price-original {
  font-family: var(--rd-font-mono);
  font-size: .82rem;
  color: var(--rd-text-muted);
  text-decoration: line-through;
}
.rd-shop-grid .product-card__actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

/* btn — scoped to shop grid */
.rd-shop-grid .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--rd-font-body);
  font-weight: 700;
  letter-spacing: .03em;
  font-size: .9rem;
  padding: 12px 24px;
  border-radius: 0;
  border: 2px solid transparent;
  box-shadow: none;
  clip-path: var(--rd-chamfer-clip);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--rd-transition),
              color var(--rd-transition),
              border-color var(--rd-transition),
              transform var(--rd-transition),
              filter var(--rd-transition);
  white-space: nowrap;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.rd-shop-grid .btn--primary {
  background: var(--rd-primary);
  color: #fff;
  border-color: var(--rd-outline);
}
.rd-shop-grid .btn--primary:hover {
  background: var(--rd-primary-dark);
  border-color: var(--rd-outline);
  transform: translate(-1px, -1px);
  filter: brightness(1.08);
  color: #fff;
  text-decoration: none;
}
.rd-shop-grid .btn--primary:active {
  background: var(--rd-primary-active);
  transform: translate(1px, 1px);
  filter: none;
}
.rd-shop-grid .btn--sm {
  font-size: .82rem;
  padding: 8px 16px;
}

/* badge — scoped to shop grid */
.rd-shop-grid .badge {
  --rd-chamfer: 4px;
  display: inline-block;
  font-family: var(--rd-font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 4px 9px;
  border-radius: 0;
  border: 1px solid var(--rd-outline);
  clip-path: var(--rd-chamfer-clip);
  color: #fff;
  line-height: 1.4;
}
.rd-shop-grid .badge--sale { background: var(--rd-danger); }
.rd-shop-grid .badge--new  { background: var(--rd-primary); }
.rd-shop-grid .badge--free { background: var(--rd-success); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .rd-cols-5 { grid-template-columns: repeat(4, 1fr); }
  .rd-cols-6 { grid-template-columns: repeat(4, 1fr); }
  .rd-shop-grid--cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .rd-cols-4,
  .rd-cols-5,
  .rd-cols-6 { grid-template-columns: repeat(3, 1fr); }
  .rd-shop-grid--cols-3,
  .rd-shop-grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .rd-cols-3,
  .rd-cols-4,
  .rd-cols-5,
  .rd-cols-6 { grid-template-columns: repeat(2, 1fr); }
  .rd-product-grid { gap: 16px; }
  .rd-shop-grid--cols-2,
  .rd-shop-grid--cols-3,
  .rd-shop-grid--cols-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .rd-cols-2,
  .rd-cols-3,
  .rd-cols-4,
  .rd-cols-5,
  .rd-cols-6 { grid-template-columns: repeat(1, 1fr); }
  .rd-tabs { gap: 6px; }
  .rd-tab-btn { font-size: .8rem; padding: 7px 14px; }
}

