/* Spares4Repairs Design System */
/* Mobile-first, production-quality */

:root {
  --brand-orange: #e65100;
  --brand-orange-hover: #bf360c;
  --brand-dark: #1a1a2e;
  --brand-dark-lighter: #2d2d44;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #556270;
  --text-light: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --max-width: 1200px;
  --header-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text-primary); background: var(--bg-secondary); line-height: 1.6; }
a { color: var(--brand-orange); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* === LAYOUT === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* === HEADER === */
.site-header { background: var(--brand-dark); height: var(--header-height); position: sticky; top: 0; z-index: 100; }
.site-header__inner { display: flex; align-items: center; height: 100%; gap: 16px; }
.site-header__logo img { height: 38px; }
.site-header__search { flex: 1; max-width: 500px; position: relative; margin: 0 auto; }
.site-header__search input { width: 100%; padding: 10px 16px 10px 40px; border: none; border-radius: var(--radius-md); font-size: 0.9375rem; background: rgba(255,255,255,0.1); color: #fff; outline: none; transition: background 0.2s; }
.site-header__search input::placeholder { color: rgba(255,255,255,0.5); }
.site-header__search input:focus { background: rgba(255,255,255,0.15); }
.site-header__search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.5); }
.site-header__actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.site-header__basket { color: #fff; display: flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 500; padding: 8px 14px; border-radius: var(--radius-md); background: rgba(255,255,255,0.08); }
.site-header__basket:hover { background: rgba(255,255,255,0.12); text-decoration: none; }

/* === DELIVERY BANNER === */
.delivery-banner { background: var(--brand-orange); color: #fff; text-align: center; padding: 8px 16px; font-size: 0.8125rem; font-weight: 500; }

/* === BREADCRUMB === */
.breadcrumb { padding: 12px 0; font-size: 0.8125rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-orange); }
.breadcrumb__sep { margin: 0 6px; }

/* === FOOTER === */
.site-footer { background: var(--brand-dark); color: #fff; margin-top: 48px; padding: 40px 0 24px; }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; margin-bottom: 32px; }
.site-footer__col h4 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); margin-bottom: 12px; }
.site-footer__col a { display: block; color: #d1d5db; font-size: 0.875rem; margin-bottom: 8px; }
.site-footer__col a:hover { color: var(--brand-orange); text-decoration: none; }
.site-footer__bottom { border-top: 1px solid var(--brand-dark-lighter); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.75rem; color: var(--text-light); }

/* === TRUST BADGES === */
.trust-bar { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; padding: 20px 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); }
.trust-badge { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.trust-badge svg { width: 20px; height: 20px; color: var(--success); }

/* === SECTION === */
.section { padding: 32px 0; }
.section__title { font-size: 1.375rem; font-weight: 700; margin-bottom: 16px; }
.section__subtitle { color: var(--text-muted); font-size: 0.9375rem; margin-top: -8px; margin-bottom: 20px; }

/* === CARDS === */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
@media (min-width: 768px) { .card-grid { gap: 20px; } }
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid--brands { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Product Card */
.product-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; transition: box-shadow 0.2s, border-color 0.2s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand-orange); text-decoration: none; color: inherit; }
.product-card__img { width: 100%; height: 140px; background: #fff; border-radius: var(--radius-sm); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 0.75rem; overflow: hidden; }
.product-card__img img { width: 100%; height: 100%; object-fit: contain; }
.product-card__title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; line-height: 1.3; }
.product-card__partno { font-family: monospace; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.product-card__desc { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 12px; flex: 1; }
.product-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.product-card__price { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); margin-top: 8px; }
.product-card__price--unavailable { font-size: 0.8125rem; font-weight: 600; color: var(--error); }
.product-card__price--request { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.product-card__status { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; padding: 2px 8px; border-radius: 12px; }
.product-card__status--available { background: #ecfdf5; color: var(--success); }
.product-card__status--unavailable { background: #fef2f2; color: var(--error); }
.product-card__cta { display: inline-block; padding: 8px 16px; background: var(--brand-orange); color: #fff; border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 600; margin-top: 12px; text-align: center; }
.product-card__cta:hover { background: var(--brand-orange-hover); text-decoration: none; }

/* Category Card */
.category-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; text-align: center; transition: box-shadow 0.2s, border-color 0.2s; }
.category-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand-orange); text-decoration: none; }
.category-card__icon { width: 48px; height: 48px; margin: 0 auto 12px; background: var(--bg-tertiary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.category-card__name { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.category-card__count { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Brand Card */
.brand-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 20px; display: flex; align-items: center; gap: 12px; transition: box-shadow 0.2s, border-color 0.2s; min-height: 72px; }
.brand-card:hover { box-shadow: var(--shadow-sm); border-color: var(--brand-orange); text-decoration: none; }
.brand-card img { width: 60px; height: 28px; object-fit: contain; flex-shrink: 0; }
.brand-card__name { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.brand-card__count { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

/* Model Card */
.model-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 18px; transition: background 0.15s, border-color 0.15s; }
.model-card:hover { background: var(--bg-secondary); border-color: var(--brand-orange); text-decoration: none; }
.model-card__name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.model-card__meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* === CTA PANEL === */
.cta-panel { background: linear-gradient(135deg, var(--brand-dark) 0%, #0f3460 100%); border-radius: var(--radius-xl); padding: 32px; color: #fff; text-align: center; }
.cta-panel h2 { font-size: 1.25rem; margin-bottom: 8px; }
.cta-panel p { color: #d1d5db; font-size: 0.9375rem; margin-bottom: 20px; }
.cta-panel__btn { display: inline-block; padding: 12px 28px; background: var(--brand-orange); color: #fff; border-radius: var(--radius-md); font-weight: 600; }
.cta-panel__btn:hover { background: var(--brand-orange-hover); text-decoration: none; }

/* === HERO === */
.hero { background: var(--brand-dark); color: #fff; padding: 40px 0; }
.hero h1 { font-size: 1.75rem; margin-bottom: 8px; }
@media (min-width: 768px) { .hero h1 { font-size: 2.25rem; } }
.hero p { color: #d1d5db; font-size: 1rem; max-width: 600px; margin-bottom: 24px; }
.hero__search { max-width: 500px; display: flex; gap: 8px; }
.hero__search input { flex: 1; padding: 14px 18px; border: none; border-radius: var(--radius-md); font-size: 1rem; }
.hero__search button { padding: 14px 24px; background: var(--brand-orange); color: #fff; border: none; border-radius: var(--radius-md); font-size: 0.9375rem; font-weight: 600; cursor: pointer; white-space: nowrap; }

/* === PRODUCT PAGE === */
.product-page { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 24px 0; }
@media (min-width: 768px) { .product-page { grid-template-columns: 1fr 1fr; } }
.product-gallery { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; min-height: 300px; display: flex; align-items: center; justify-content: center; color: var(--text-light); }
.product-info h1 { font-size: 1.375rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.product-info__partno { font-family: monospace; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 4px; }
.product-info__alts { font-size: 0.8125rem; color: var(--text-light); margin-bottom: 16px; }
.product-info__price { font-size: 1.75rem; font-weight: 700; margin-bottom: 4px; }
.product-info__stock { font-size: 0.875rem; color: var(--success); font-weight: 500; margin-bottom: 20px; }
.product-info__delivery { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 20px; padding: 12px 16px; background: var(--bg-tertiary); border-radius: var(--radius-md); }
.product-info__btn { display: block; width: 100%; padding: 14px; background: var(--brand-orange); color: #fff; border: none; border-radius: var(--radius-md); font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center; }
.product-info__btn:hover { background: var(--brand-orange-hover); text-decoration: none; }
.product-info__compat { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.product-info__compat h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 8px; }

/* === COMPAT LIST === */
.compat-list { margin-top: 8px; }
.compat-item { padding: 8px 12px; margin-bottom: 4px; background: var(--bg-tertiary); border-radius: var(--radius-sm); font-size: 0.8125rem; }
.compat-item a { color: var(--text-primary); font-weight: 500; }
.compat-item a:hover { color: var(--brand-orange); }

/* === INFO BOX === */
.info-box { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.info-box h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.info-box p { font-size: 0.875rem; color: var(--text-secondary); }

/* === PAGINATION === */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 24px 0; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--text-secondary); }
.pagination a:hover { border-color: var(--brand-orange); color: var(--brand-orange); text-decoration: none; }
.pagination .active { background: var(--brand-orange); color: #fff; border-color: var(--brand-orange); }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state h2 { font-size: 1.25rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }


/* === CATEGORY BROWSE CARDS (horizontal layout like Ransom Spares) === */
.cat-browse-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .cat-browse-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cat-browse-grid { grid-template-columns: 1fr; } }
.cat-browse-card { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color 0.2s, box-shadow 0.2s; }
.cat-browse-card:hover { border-color: var(--brand-orange); box-shadow: var(--shadow-sm); text-decoration: none; }
.cat-browse-card__img { width: 56px; height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cat-browse-card__img img { width: 48px; height: 48px; }
.cat-browse-card__text { flex: 1; }
.cat-browse-card__name { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.cat-browse-card__cta { font-size: 0.8125rem; color: var(--brand-orange); font-weight: 500; }

/* === LIVE PRICE STATES === */
.live-price__loading { color: var(--text-light); font-size: 0.875rem; }
.live-price__value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.live-price__unavailable { font-size: 1rem; font-weight: 600; color: var(--error); }
.live-price__error { font-size: 0.875rem; color: var(--text-muted); font-style: italic; }
.product-card .live-price__loading { font-size: 0.8125rem; }
.product-card .live-price__value { font-size: 1.125rem; }
.product-card .live-price__unavailable { font-size: 0.8125rem; }

/* === ADD TO BASKET === */
.add-to-basket { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.add-to-basket__label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.add-to-basket__qty { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9375rem; background: var(--bg-primary); }
.add-to-basket__btn { padding: 14px 32px; background: var(--brand-orange); color: #fff; border: none; border-radius: var(--radius-md); font-size: 0.9375rem; font-weight: 600; cursor: pointer; transition: background 0.2s; display: block; }
.add-to-basket__btn:hover { background: var(--brand-orange-hover); }
.add-to-basket__btn:disabled { background: var(--text-light); cursor: not-allowed; }

/* === AVAILABILITY BADGE === */
.availability-badge { display: inline-block; font-size: 0.8125rem; font-weight: 600; padding: 4px 10px; border-radius: 12px; }
.availability-badge--in-stock { background: #ecfdf5; color: var(--success); }
.availability-badge--unavailable { background: #fef2f2; color: var(--error); }
.availability-badge--loading { background: var(--bg-tertiary); color: var(--text-light); }

/* === DELIVERY & RETURNS PANEL === */
.delivery-returns-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 20px; }
.delivery-returns-panel__item { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.delivery-returns-panel__item:last-child { border-bottom: none; }
.delivery-returns-panel__item svg { flex-shrink: 0; color: var(--success); margin-top: 2px; }
.delivery-returns-panel__item strong { font-size: 0.875rem; color: var(--text-primary); }
.delivery-returns-panel__item div { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }

/* === COMPATIBILITY PANEL === */
.compatibility-panel { display: flex; align-items: flex-start; gap: 14px; padding: 20px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: var(--radius-lg); margin-bottom: 20px; }
.compatibility-panel svg { flex-shrink: 0; margin-top: 2px; }
.compatibility-panel strong { display: block; font-size: 1rem; color: #065f46; margin-bottom: 4px; }
.compatibility-panel p { font-size: 0.875rem; color: #047857; margin: 0; }

/* === IMAGE GALLERY === */
.image-gallery { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.image-gallery__main { display: flex; align-items: center; justify-content: center; min-height: 300px; margin-bottom: 12px; }
.image-gallery__main img { max-width: 100%; max-height: 400px; object-fit: contain; }
.image-gallery__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.image-gallery__thumb { padding: 4px; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: none; }
.image-gallery__thumb.active { border-color: var(--brand-orange); }
.image-gallery__thumb img { width: 60px; height: 60px; object-fit: contain; }
.image-gallery__placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; color: var(--text-light); }
.image-gallery__placeholder p { margin-top: 8px; font-size: 0.875rem; }
.image-gallery--empty { background: var(--bg-tertiary); }

/* === PRODUCT CARD ENHANCEMENTS === */
.product-card__placeholder { width: 100%; height: 140px; display: flex; align-items: center; justify-content: center; background: var(--bg-tertiary); border-radius: var(--radius-sm); margin-bottom: 12px; }
.product-card__body { flex: 1; display: flex; flex-direction: column; }
.product-card__alt { font-size: 0.625rem; background: var(--bg-tertiary); padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
.product-card__compat { font-size: 0.75rem; color: var(--success); margin-top: 4px; }

/* === MODEL CARD === */
.model-card { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; transition: background 0.15s, border-color 0.15s; }
.model-card:hover { background: var(--bg-secondary); border-color: var(--brand-orange); text-decoration: none; }
.model-card__model { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.model-card__count { font-size: 0.75rem; color: var(--text-muted); background: var(--bg-tertiary); padding: 2px 8px; border-radius: 10px; }

/* === SEARCH HEADER BUTTON === */
.site-header__search button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--brand-orange); border: none; border-radius: var(--radius-sm); padding: 6px 12px; color: #fff; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.site-header__search button:hover { background: var(--brand-orange-hover); }

/* === RESPONSIVE HIDING === */
@media (max-width: 640px) {
  .site-header__basket span { display: none; }
  .trust-bar { gap: 12px; padding: 12px 16px; }
  .trust-badge { font-size: 0.75rem; }
  .hero h1 { font-size: 1.375rem; }
  .section__title { font-size: 1.125rem; }
}

/* === FOCUS STYLES (Accessibility) === */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--brand-orange);
  outline-offset: 2px;
}
.product-card:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.cat-browse-card:focus-visible, .brand-card:focus-visible, .model-card:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
