/* ====================================
   SINGLE PRODUCT PAGE - Modern B2B Theme
   ==================================== */

:root {
  --sp-primary: #054297;
  --sp-primary-light: #1f3a93;
  --sp-accent: #ff9800;
  --sp-success: #28a745;
  --sp-border: #e3e7ee;
  --sp-gray-50: #f8f9fa;
  --sp-gray-100: #e9ecef;
  --sp-gray-600: #6c757d;
  --sp-text: #333;
  --sp-radius: 12px;
  --sp-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --sp-shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

/* ========== Product Container ========== */
.sp-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 10px;
}

/* ========== Breadcrumb ========== */
.sp-breadcrumb {
  background: var(--sp-gray-50);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.sp-breadcrumb a {
  color: var(--sp-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.sp-breadcrumb a:hover {
  color: var(--sp-accent);
}

.sp-breadcrumb-separator {
  color: #999;
  margin: 0 4px;
}

.sp-breadcrumb-current {
  color: #777;
}

/* ========== Main Product Section ========== */
.sp-product-main {
  background: white;
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.sp-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 25px;
}

/* ========== Product Image ========== */
.sp-image-container {
  position: relative;
  background: var(--sp-gray-50);
  border-radius: var(--sp-radius);
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.sp-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  max-height: 450px;
}

/* ========== Product Info ========== */
.sp-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sp-category-tag {
  background: var(--sp-gray-100);
  color: var(--sp-primary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--sp-border);
}

.sp-category-tag:hover {
  background: var(--sp-primary);
  color: white;
  text-decoration: none;
}

.sp-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--sp-text);
  line-height: 1.3;
  margin: 0;
}

.sp-description {
  background: var(--sp-gray-50);
  padding: 14px;
  border-radius: 8px;
  line-height: 1.5;
  color: #555;
  font-size: 14px;
  max-height: 80px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.sp-description.expanded {
  max-height: none;
}

.sp-description.has-overflow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--sp-gray-50));
  pointer-events: none;
}

.sp-description.expanded::after {
  display: none;
}

.sp-read-more {
  display: inline-block;
  margin-top: 8px;
  color: var(--sp-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.sp-read-more:hover {
  color: var(--sp-primary);
  text-decoration: underline;
}

.sp-read-more i {
  margin-left: 4px;
  font-size: 11px;
  transition: transform 0.3s;
}

.sp-description.expanded + .sp-read-more i {
  transform: rotate(180deg);
}

.sp-barcode {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--sp-gray-50);
  border-radius: 6px;
  font-size: 13px;
}

.sp-barcode-label {
  font-weight: 600;
  color: #666;
}

.sp-barcode-value {
  color: var(--sp-text);
  font-family: 'Courier New', monospace;
}

/* ========== Discount Banner - Minimal ========== */
.sp-discount-banner {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sp-discount-banner > i {
  color: #666;
  font-size: 18px;
  flex-shrink: 0;
}

.sp-discount-text {
  flex: 1;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.sp-discount-text strong {
  color: var(--sp-primary);
  font-weight: 700;
}

.sp-discount-condition {
  display: inline-block;
  margin-left: 8px;
  color: #666;
  font-size: 12px;
}

.sp-discount-btn {
  background: var(--sp-primary);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sp-discount-btn:hover {
  background: var(--sp-primary-light);
}

/* ========== Price Section ========== */
.sp-price-card {
  background: linear-gradient(135deg, var(--sp-gray-50) 0%, var(--sp-gray-100) 100%);
  border-radius: var(--sp-radius);
  padding: 18px;
  border: 2px solid var(--sp-accent);
  position: relative;
  overflow: hidden;
}

.sp-price-card.has-discount::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: var(--sp-accent);
  opacity: 0.05;
  border-radius: 50%;
}

.sp-discount-badge-corner {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--sp-primary);
  color: white;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(5, 66, 151, 0.3);
  transform: rotate(15deg);
  z-index: 2;
}

.sp-discount-percent {
  font-size: 24px;
  line-height: 1;
}

.sp-discount-label {
  font-size: 9px;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.9;
}

.sp-price-original {
  color: var(--sp-gray-600);
  font-size: 13px;
  margin-bottom: 8px;
  text-decoration: line-through;
  font-weight: 500;
}

.sp-price-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.sp-price-amount {
  color: var(--sp-accent);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}

.sp-price-currency {
  color: var(--sp-accent);
  font-size: 22px;
  font-weight: 600;
}

.sp-price-vat {
  color: var(--sp-gray-600);
  font-size: 11px;
  margin-top: 2px;
}

.sp-price-savings {
  background: white;
  padding: 10px 16px;
  border-radius: 8px;
  margin-top: 12px;
  box-shadow: var(--sp-shadow-sm);
}

.sp-savings-text {
  color: var(--sp-success);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========== Quantity Grid ========== */
.sp-qty-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  align-items: end;
}

.sp-qty-info {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border: 1px solid var(--sp-primary);
  border-radius: 8px;
  padding: 14px 18px;
  text-align: center;
}

.sp-qty-info-label {
  color: #666;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.sp-qty-info-value {
  color: var(--sp-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.sp-qty-info-value span {
  font-size: 13px;
  font-weight: 600;
  margin-left: 4px;
}

.sp-qty-field {
  display: flex;
  flex-direction: column;
}

.sp-qty-field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #666;
  font-weight: 600;
}

.sp-qty-field-total .sp-qty-input-total {
  background: #f8f9fa;
  border-color: #ced4da;
  color: #495057;
  font-weight: 700;
}

.sp-qty-input {
  width: 100%;
  width: 50%;
  padding: 10px;
  border: 1px solid var(--sp-border);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.sp-qty-input:focus {
  outline: none;
  border-color: var(--sp-accent);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
}

.sp-qty-input:disabled {
  background: var(--sp-gray-100);
  cursor: not-allowed;
}

.sp-qty-updated {
  animation: qtyPulse 0.6s ease;
  border-color: var(--sp-success) !important;
  background: rgba(40, 167, 69, 0.05) !important;
}

@keyframes qtyPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* ========== Action Buttons ========== */
.sp-actions {
  display: flex;
  gap: 10px;
  margin-top: 0;
}

.sp-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.sp-btn-primary {
  background: var(--sp-accent);
  color: white;
}

.sp-btn-primary:hover {
  background: #e68900;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.3);
  color: white;
}

.sp-btn-update {
  background: var(--sp-primary);
  color: white;
}

.sp-btn-update:hover {
  background: var(--sp-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 66, 151, 0.3);
  color: white;
}

.sp-btn-disabled {
  background: var(--sp-gray-100);
  color: #999;
  cursor: not-allowed;
}

.sp-btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ========== Tabs Section ========== */
.sp-tabs {
  background: white;
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.sp-tab-headers {
  display: flex;
  border-bottom: 2px solid var(--sp-border);
  background: var(--sp-gray-50);
}

.sp-tab-label {
  flex: 1;
  display: block;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  text-align: center;
  margin: 0;
}

.sp-tab-radio {
  display: none;
}

#tab-description:checked ~ .sp-tab-headers label[for="tab-description"],
#tab-dimensions:checked ~ .sp-tab-headers label[for="tab-dimensions"],
#tab-specs:checked ~ .sp-tab-headers label[for="tab-specs"] {
  color: var(--sp-accent);
  border-bottom-color: var(--sp-accent);
  background: white;
}

.sp-tab-label:hover {
  color: var(--sp-accent);
  background: rgba(255, 152, 0, 0.05);
}

.sp-tab-content {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s;
}

#tab-description:checked ~ div[data-tab="description"],
#tab-dimensions:checked ~ div[data-tab="dimensions"],
#tab-specs:checked ~ div[data-tab="specs"] {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Specs Table ========== */
.sp-specs-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--sp-border);
  border-radius: 8px;
  overflow: hidden;
}

.sp-specs-table tr:nth-child(even) {
  background: var(--sp-gray-50);
}

.sp-specs-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--sp-border);
}

.sp-specs-table td:first-child {
  font-weight: 600;
  color: #555;
  width: 40%;
}

.sp-specs-table tr:last-child td {
  border-bottom: none;
}

/* ========== Related Products ========== */
.sp-related {
  background: white;
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-sm);
  padding: 20px;
}

.sp-related.showroom-home {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.sp-related.showroom-home .featured-products {
  margin-bottom: 0 !important;
}

.sp-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.sp-related-grid .item {
  min-width: 0;
}

.sp-related.showroom-home .sp-related-grid .b2b-product-card {
  margin: 0 !important;
  height: 100% !important;
}

.sp-related-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--sp-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--sp-border);
}

.sp-related-item {
  background: var(--sp-gray-50);
  border-radius: var(--sp-radius);
  padding: 16px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  transition: all 0.3s;
  border: 1px solid var(--sp-border);
}

.sp-related-item:hover {
  box-shadow: var(--sp-shadow-md);
  transform: translateY(-2px);
}

.sp-related-image {
  background: white;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-related-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 140px;
}

.sp-related-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sp-related-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--sp-text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.sp-related-name a {
  color: inherit;
  text-decoration: none;
}

.sp-related-name a:hover {
  color: var(--sp-accent);
}

.sp-related-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--sp-accent);
  margin-bottom: 10px;
}

.sp-related-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.sp-related-qty {
  flex: 1;
  max-width: 120px;
}

.sp-related-btn {
  flex: 1;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
  .sp-product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 15px;
  }

  .sp-discount-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .sp-discount-btn {
    width: 100%;
    justify-content: center;
  }

  .sp-title {
    font-size: 20px;
  }
  
  .sp-info {
    gap: 10px;
  }
  
  .sp-category-tags {
    margin-bottom: 8px;
  }
}

@media (max-width: 768px) {
  .sp-container {
    padding: 10px 8px;
  }

  .sp-product-grid {
    padding: 15px 12px;
    gap: 15px;
  }

  .sp-image-container {
    min-height: 250px;
    padding: 15px;
  }

  .sp-title {
    font-size: 18px;
  }
  
  .sp-info {
    gap: 8px;
  }
  
  .sp-description {
    padding: 12px;
    font-size: 13px;
    max-height: 70px;
  }
  
  .sp-category-tags {
    gap: 6px;
  }
  
  .sp-category-tag {
    padding: 4px 10px;
    font-size: 11px;
  }

  .sp-price-amount {
    font-size: 32px;
  }

  .sp-price-currency {
    font-size: 18px;
  }
  
  .sp-price-card {
    padding: 14px;
  }

  .sp-discount-badge-corner {
    width: 65px;
    height: 65px;
  }

  .sp-discount-percent {
    font-size: 18px;
  }
  
  .sp-discount-banner {
    padding: 12px 14px;
  }
  
  .sp-discount-text {
    font-size: 13px;
  }
  
  .sp-discount-condition {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }

  .sp-actions {
    flex-direction: column;
  }

  .sp-tab-headers {
    flex-direction: column;
  }

  .sp-tab-content {
    padding: 15px 12px;
  }

  .sp-related-grid {
    grid-template-columns: 1fr;
  }

  .sp-qty-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .sp-qty-info {
    padding: 12px 14px;
  }
  
  .sp-qty-info-value {
    font-size: 20px;
  }

  .sp-breadcrumb {
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .sp-breadcrumb {
    font-size: 11px;
    padding: 7px 10px;
  }

  .sp-title {
    font-size: 16px;
  }
  
  .sp-description {
    padding: 10px;
    font-size: 12px;
    max-height: 60px;
  }
  
  .sp-product-grid {
    padding: 12px 10px;
  }
  
  .sp-image-container {
    min-height: 200px;
    padding: 12px;
  }
  
  .sp-image {
    max-height: 220px;
  }

  .sp-price-amount {
    font-size: 28px;
  }
  
  .sp-price-card {
    padding: 12px;
  }

  .sp-discount-badge {
    width: 55px;
    height: 55px;
    font-size: 14px;
  }
  
  .sp-discount-banner {
    padding: 8px;
  }

  .sp-discount-title {
    font-size: 14px;
  }

  .sp-discount-qty-value,
  .sp-discount-final-price {
    font-size: 14px;
    padding: 8px 12px;
  }

  .sp-btn {
    padding: 12px 16px;
    font-size: 12px;
  }

  .sp-tab-label {
    padding: 12px 14px;
    font-size: 13px;
  }
  
  .sp-tab-content {
    padding: 12px 10px;
  }
  
  .sp-related.showroom-home .featured-products {
    padding: 16px 14px 10px !important;
  }
}
