/* AutoCore Single Product Page Styles
 * Scoped with .ac-single-product namespace
 * Light, modern design with rounded corners and proper spacing
 */

:root {
  --ac-sp-bg: #ffffff;
  --ac-sp-card-bg: #ffffff;
  --ac-sp-border: #e5e7eb;
  --ac-sp-muted: #6b7280;
  --ac-sp-muted2: #9ca3af;
  --ac-sp-dark: #111827;
  --ac-sp-accent: #ff7a00;
  --ac-sp-accent-hover: #f97316;
  --ac-sp-radius: 20px;
  --ac-sp-shadow: 0 10px 30px rgba(0,0,0,0.06);
  --ac-sp-shadow-hover: 0 18px 45px rgba(0,0,0,0.09);
}

.ac-single-product {
  max-width: 1200px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--ac-sp-dark);
}

/* --- Main two-column grid container --- */
.ac-single-product__main {
  display: grid;
  grid-template-columns: minmax(420px, 58%) minmax(340px, 42%);
  gap: 28px;
  align-items: start;
}

@media (max-width: 992px) {
  .ac-single-product__main {
    grid-template-columns: 1fr;
  }
}

/* --- Media (Image) Section --- */
.ac-single-product__media {
  width: 100%;
}

.ac-single-product__image-container {
  position: relative;
  width: 100%;
  background: #f9fafb;
  border-radius: var(--ac-sp-radius);
  overflow: hidden;
  border: 1px solid var(--ac-sp-border);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ac-single-product__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--ac-sp-bg);
}

.ac-single-product__image-fallback {
  padding: 32px;
  text-align: center;
  color: var(--ac-sp-muted2);
  font-size: 14px;
}

/* --- Summary Section --- */
.ac-single-product__summary {
  background: var(--ac-sp-card-bg);
  border: 1px solid var(--ac-sp-border);
  border-radius: var(--ac-sp-radius);
  padding: 28px 32px;
  box-shadow: var(--ac-sp-shadow);
}

.ac-single-product__header {
  margin-bottom: 24px;
}

.ac-single-product__title {
  margin: 0 0 12px 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ac-sp-dark);
}

.ac-single-product__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.ac-single-product__meta-item {
  display: flex;
  flex-direction: column;
}

.ac-single-product__meta-label {
  font-size: 12px;
  color: var(--ac-sp-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.ac-single-product__meta-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ac-sp-dark);
}

.ac-single-product__price-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f3f4f6;
}

.ac-single-product__price {
  font-size: 24px;
  font-weight: 900;
  color: var(--ac-sp-dark);
}

.ac-single-product__price-unavailable {
  font-size: 24px;
  font-weight: 700;
  color: var(--ac-sp-muted);
}

.ac-single-product__stock-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.ac-single-product__stock-badge.in-stock {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #059669;
}

.ac-single-product__stock-badge.out-of-stock {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

/* --- Buy Form --- */
.ac-single-product__buy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ac-single-product__buy-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ac-sp-dark);
}

.ac-single-product__buy-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ac-single-product__qty-input {
  width: 96px;
  height: 48px;
  border: 1px solid var(--ac-sp-border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  background: var(--ac-sp-bg);
  color: var(--ac-sp-dark);
  box-sizing: border-box;
}

.ac-single-product__buy-btn {
  min-width: 150px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  background: var(--ac-sp-accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 122, 0, 0.25);
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ac-single-product__buy-btn:hover {
  background: var(--ac-sp-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 122, 0, 0.3);
}

.ac-single-product__buy-btn:active {
  transform: translateY(0);
}

.ac-single-product__buy-btn:disabled {
  background: var(--ac-sp-muted2);
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Stocks Table --- */
.ac-single-product__stocks {
  margin-top: 24px;
}

.ac-single-product__stocks-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--ac-sp-dark);
}

.ac-single-product__stocks-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ac-sp-card-bg);
  border: 1px solid var(--ac-sp-border);
  border-radius: var(--ac-sp-radius);
  overflow: hidden;
}

.ac-single-product__stocks-table th,
.ac-single-product__stocks-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.ac-single-product__stocks-table th {
  background: #f9fafb;
  font-size: 13px;
  font-weight: 700;
  color: var(--ac-sp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ac-single-product__stocks-table tr:last-child td {
  border-bottom: none;
}

.ac-single-product__stocks-table td:last-child {
  text-align: right;
}

/* --- Analogs Section --- */
.ac-single-product__analogs {
  margin-top: 32px;
  background: var(--ac-sp-card-bg);
  border: 1px solid var(--ac-sp-border);
  border-radius: var(--ac-sp-radius);
  padding: 28px 32px;
  box-shadow: var(--ac-sp-shadow);
}

.ac-single-product__analogs-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--ac-sp-dark);
}

.ac-single-product__analogs-empty {
  padding: 32px;
  text-align: center;
  color: var(--ac-sp-muted);
  font-size: 15px;
}

.ac-single-product__analogs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.ac-single-product__analog-card {
  border: 1px solid var(--ac-sp-border);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.ac-single-product__analog-card:hover {
  box-shadow: var(--ac-sp-shadow-hover);
  transform: translateY(-2px);
}

.ac-single-product__analog-image-container {
  width: 100%;
  height: 120px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.ac-single-product__analog-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.ac-single-product__analog-no-image {
  padding: 12px;
  text-align: center;
  color: var(--ac-sp-muted2);
  font-size: 12px;
}

.ac-single-product__analog-content {
  padding: 16px;
}

.ac-single-product__analog-brand {
  font-size: 12px;
  color: var(--ac-sp-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ac-single-product__analog-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ac-sp-dark);
  margin-bottom: 10px;
  line-height: 1.4;
}

.ac-single-product__analog-price {
  font-size: 18px;
  font-weight: 900;
  color: var(--ac-sp-dark);
  margin-bottom: 12px;
}

.ac-single-product__analog-price-unavailable {
  font-size: 16px;
  font-weight: 700;
  color: var(--ac-sp-muted);
}

.ac-single-product__analog-btn {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  background: var(--ac-sp-accent);
  color: #fff;
  transition: background 0.2s ease;
}

.ac-single-product__analog-btn:hover {
  background: var(--ac-sp-accent-hover);
}

.ac-single-product__back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ac-sp-dark);
  font-weight: 700;
  margin-top: 24px;
  background: var(--ac-sp-bg);
  border: 1px solid var(--ac-sp-border);
  transition: background 0.2s ease;
}

.ac-single-product__back-link:hover {
  background: #f3f4f6;
}

.ac-single-product__back-icon {
  font-size: 18px;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .ac-single-product {
    padding: 0 16px;
  }
  
  .ac-single-product__media {
    max-width: 320px;
    flex: 0 0 320px;
  }
  
  .ac-single-product__analog-card {
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .ac-single-product {
    padding: 0 16px;
  }
  
  .ac-single-product__media {
    max-width: 280px;
    flex: 0 0 280px;
  }
  
  .ac-single-product__summary {
    padding: 20px 24px;
  }
  
  .ac-single-product__title {
    font-size: 22px;
  }
  
  .ac-single-product__analogs-list {
    grid-template-columns: 1fr;
  }
  
  .ac-single-product__buy-controls {
    flex-direction: column;
  }
  
  .ac-single-product__qty-input {
    width: 100%;
  }
  
  .ac-single-product__buy-btn {
    width: 100%;
  }
}