/**
 * ARC Inventory - Structural Styles
 *
 * Provides layout and functional styles.
 * Inherits colors, typography, and spacing from WordPress theme.
 *
 * Override these CSS custom properties in your theme for customization.
 */

:root {
  --arc-container-padding: 1rem;
  --arc-grid-gap: 1.25rem;
  --arc-card-padding: 1rem;
  --arc-gallery-height: 250px;
  --arc-border-radius: 4px;
  --arc-sidebar-width: 240px;

  /* Customizable colors - can be overridden via admin settings or theme */
  --arc-button-bg: #1f2937;
  --arc-button-color: #ffffff;
  --arc-button-border: #1f2937;
  --arc-outlined-button-border: #d1d5db;
  --arc-outlined-button-color: inherit;
  --arc-outlined-button-bg: #ffffff;
  --arc-chip-new-bg: #10b981;
  --arc-chip-new-color: #ffffff;
  --arc-chip-used-bg: #3b82f6;
  --arc-chip-used-color: #ffffff;
  --arc-chip-bg: #f3f4f6;
  --arc-chip-color: inherit;
}

/**
 * Base Container & Box Sizing
 */
.arc-inventory,
.arc-inventory *,
.arc-inventory *::before,
.arc-inventory *::after {
  box-sizing: border-box;
}

.arc-inventory input,
.arc-inventory select,
.arc-inventory button {
  box-sizing: border-box;
}

/**
 * Sidebar + Content Layout
 */
.arc-layout {
  display: flex;
  gap: 2rem;
}

@media (max-width: 767px) {
  .arc-layout {
    flex-direction: column;
    gap: 1rem;
  }
}

/**
 * Sidebar
 */
.arc-sidebar {
  width: var(--arc-sidebar-width);
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .arc-sidebar {
    width: 100%;
  }
}

.arc-sidebar-search {
  margin-bottom: 1.25rem;
}

.arc-sidebar-clear {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  text-align: center;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: var(--arc-border-radius);
  cursor: pointer;
  color: inherit;
  /* font-weight removed - inherit from theme */
}

/**
 * Filter Sections
 */
.arc-filter-section {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}

.arc-filter-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.625rem 0;
  font-size: 0.9375rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  text-align: left;
  /* font-weight removed - will use <strong> tag in HTML */
}

.arc-filter-heading svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.arc-filter-section--open .arc-filter-heading svg {
  transform: rotate(180deg);
}

.arc-filter-list {
  display: none;
  padding-bottom: 0.5rem;
}

.arc-filter-section--open .arc-filter-list {
  display: block;
}

/**
 * Filter Options (radio buttons)
 */
.arc-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  cursor: pointer;
}

.arc-filter-option input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.arc-filter-option-label {
  flex: 1;
}

.arc-filter-option-count {
  color: #9ca3af;
  font-size: 0.8125rem;
}

/**
 * Search Input
 */
.arc-filter-input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: var(--arc-border-radius);
  background-color: #fff;
  color: #1f2937;
  line-height: 1.5;
  height: 2.5rem;
}

.arc-filter-input:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 1px #6b7280;
}

.arc-search-wrapper {
  position: relative;
}

.arc-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}

.arc-search-wrapper .arc-filter-input {
  padding-left: 2.25rem;
}

/**
 * Main Content Area
 */
.arc-main {
  flex: 1;
  min-width: 0;
}

/**
 * Toolbar
 */
.arc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.arc-toolbar-count {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  /* font-weight removed - will use <strong> tag in HTML */
}

/**
 * Content Grid
 */
.arc-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--arc-grid-gap);
}

@media (min-width: 640px) {
  .arc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .arc-grid { grid-template-columns: repeat(3, 1fr); }
}

/**
 * Card Structure
 */
.arc-card {
  border-radius: var(--arc-border-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

/**
 * Gallery
 */
.arc-gallery {
  position: relative;
  height: var(--arc-gallery-height);
  overflow: hidden;
  flex-shrink: 0;
}

.arc-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.arc-gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.arc-gallery-placeholder svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.3;
}

/* Gallery Navigation */
.arc-gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.arc-gallery:hover .arc-gallery-btn {
  opacity: 1;
}

.arc-gallery-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.arc-gallery-btn--prev { left: 0.5rem; }
.arc-gallery-btn--next { right: 0.5rem; }

.arc-gallery-btn svg {
  width: 1rem;
  height: 1rem;
}

.arc-gallery-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.arc-gallery-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.arc-gallery-dot:hover {
  background: rgba(255, 255, 255, 0.75);
}

.arc-gallery-dot--active {
  background: white;
  transform: scale(1.25);
}

.arc-gallery-more {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

.arc-gallery-counter {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.75rem;
  border-radius: 9999px;
}

/**
 * Condition Badge
 */
.arc-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  /* font-weight removed - will use <strong> tag in HTML */
}

.arc-badge--new {
  background: var(--arc-chip-new-bg);
  color: var(--arc-chip-new-color);
}

.arc-badge--used {
  background: var(--arc-chip-used-bg);
  color: var(--arc-chip-used-color);
}

/**
 * Card Body
 */
.arc-card-body {
  padding: var(--arc-card-padding);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.arc-inventory h3.arc-card-title {
  margin: 0 0 0.125rem 0;
  font-size: 1.125rem;
  line-height: 1.3;
  /* font-weight removed - inherit from theme */
}

.arc-card-model {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
}

.arc-card-title-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.arc-card-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .arc-card-buttons {
    flex-direction: column;
  }
}

.arc-btn-details {
  display: block;
  text-align: center;
  padding: 0.5rem 1rem;
  flex: 1;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--arc-outlined-button-border);
  border-radius: var(--arc-border-radius);
  color: var(--arc-outlined-button-color);
  background: var(--arc-outlined-button-bg);
  cursor: pointer;
  transition: opacity 0.2s;
  /* font-weight removed - inherit from theme */
}

.arc-btn-details:hover {
  opacity: 0.8;
}

.arc-btn-message {
  display: block;
  text-align: center;
  padding: 0.5rem 1rem;
  flex: 1;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--arc-button-border);
  border-radius: var(--arc-border-radius);
  color: var(--arc-button-color);
  background: var(--arc-button-bg);
  cursor: pointer;
  transition: opacity 0.2s;
  /* font-weight removed - inherit from theme */
}

.arc-btn-message:hover {
  opacity: 0.9;
}

/**
 * Card Details Table
 */
.arc-inventory .arc-card-details {
  margin-top: auto;
  width: 100%;
  border-collapse: collapse;
  border: none !important;
}

.arc-inventory .arc-card-details th,
.arc-inventory .arc-card-details td {
  padding: 0.375rem 0;
  padding-left: 0;
  padding-right: 0;
  font-size: 0.8125rem;
  text-align: left;
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
}

.arc-inventory .arc-card-details tr:last-child th,
.arc-inventory .arc-card-details tr:last-child td {
  border-bottom: none !important;
}

.arc-inventory .arc-card-details th {
  color: inherit;
  opacity: 0.6;
  width: 40%;
  /* font-weight removed - will use <strong> tag in HTML */
}

.arc-inventory .arc-card-details td {
  color: inherit;
}

/**
 * Specs Tags (color, fuel, type chips)
 */
.arc-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.arc-spec-tag {
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--arc-border-radius);
  background: var(--arc-chip-bg);
  color: var(--arc-chip-color);
}

/**
 * State Messages
 */
.arc-empty,
.arc-loading,
.arc-error {
  text-align: center;
  padding: 4rem 1rem;
}

.arc-empty svg,
.arc-loading svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.3;
}

.arc-empty-title,
.arc-error-title {
  margin: 0 0 0.5rem 0;
}

.arc-empty-text,
.arc-error-text,
.arc-loading-text {
  margin: 0;
}

.arc-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: arc-spin 1s linear infinite;
  margin: 0 auto 1rem;
  opacity: 0.3;
}

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

/**
 * Detail Page
 */
.arc-detail {
  /* Padding removed - let theme/builder control */
}

.arc-detail-inner {
  /* Max-width and margin removed - let theme/builder control */
}

.arc-detail-back {
  margin-bottom: 1.5rem;
}

.arc-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.arc-btn-back:hover {
  text-decoration: underline;
}

.arc-btn-back svg {
  width: 1rem;
  height: 1rem;
}

.arc-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .arc-detail-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.arc-detail-gallery .arc-gallery {
  height: 300px;
  border-radius: var(--arc-border-radius);
  overflow: hidden;
}

@media (min-width: 768px) {
  .arc-detail-gallery .arc-gallery {
    height: 400px;
  }
}

.arc-detail-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.75rem;
  line-height: 1.2;
  /* font-weight removed - inherit from theme */
}

.arc-detail-model {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  color: inherit;
  opacity: 0.6;
}

.arc-detail-price-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.arc-detail-price {
  font-size: 1.5rem;
  /* font-weight removed - will use <strong> tag in HTML */
}

.arc-detail-stock {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--arc-border-radius);
  background: var(--arc-chip-bg, #f3f4f6);
  color: inherit;
  /* font-weight removed - inherit from theme */
}

.arc-btn-lead {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid var(--arc-button-border);
  border-radius: var(--arc-border-radius);
  color: var(--arc-button-color);
  background: var(--arc-button-bg);
  cursor: pointer;
  transition: opacity 0.2s;
  /* font-weight removed - inherit from theme */
}

.arc-btn-lead:hover {
  opacity: 0.9;
}

.arc-inventory .arc-detail-specs {
  width: 100%;
  border-collapse: collapse;
  border: none !important;
}

.arc-inventory .arc-detail-specs th,
.arc-inventory .arc-detail-specs td {
  padding: 0.5rem 0;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
  font-size: 0.875rem;
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
}

.arc-inventory .arc-detail-specs th {
  width: 40%;
  color: inherit;
  opacity: 0.6;
  /* font-weight removed - will use <strong> tag in HTML */
}

.arc-inventory .arc-detail-specs td {
  color: inherit;
}

.arc-inventory .arc-detail-specs tr.arc-specs-section th {
  width: auto;
  opacity: 0.45;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-top: 1.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.arc-inventory .arc-detail-specs tr.arc-specs-section:first-child th {
  padding-top: 0;
}

/**
 * Detail Description Block
 */
.arc-detail-description {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.arc-detail-description-text {
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0;
  white-space: pre-line;
  color: inherit;
  opacity: 0.75;
}
