/**
 * Commerce Product Display Styles - Book Store Theme
 * For Aristotle theme - Drupal Commerce
 * Version 2 - Clean, No Extra Wrappers
 */

/* Main Product Wrapper */
.commerce-product {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.commerce-product__wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  padding: 2.5rem;
}

/* Left Column - Book Cover Image */
.commerce-product__image-wrapper {
  flex: 0 0 42%;
  max-width: 42%;
}

.commerce-product__image-wrapper .field--name-field-image {
  position: relative;
}

.commerce-product__image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid #e8e8e8;
  transition: transform 0.3s ease;
}

.commerce-product__image-wrapper img:hover {
  transform: scale(1.02);
}

.commerce-product__no-image {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  padding: 4rem 2rem;
  text-align: center;
  border-radius: 8px;
  color: #999;
  border: 2px dashed #ccc;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Right Column - Book Details */
.commerce-product__details {
  flex: 1;
  min-width: 320px;
}

.commerce-product__title {
  margin: 0 0 1.25rem 0;
  font-size: 2.5rem;
  line-height: 1.2;
  color: #1a1a1a;
  font-weight: 700;
}

.commerce-product__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.commerce-product__title a:hover {
  color: #2c5f2d;
}

.commerce-product__body {
  margin-bottom: 2rem;
  line-height: 1.8;
  color: #444;
  font-size: 1.05rem;
}

.commerce-product__body p {
  margin-bottom: 1rem;
}

/* Cart Form - Remove all extra wrappers */
.commerce-product__details > div:not(.commerce-product__title):not(.commerce-product__body) {
  background: transparent;
  padding: 0;
  margin: 0;
  border: none;
}

.commerce-order-item-add-to-cart-form {
  background: transparent;
  padding: 0;
  border: none;
  margin: 0;
}

/* Pricing Section - Beautiful Card */
.commerce-product-variation__pricing {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 2px solid #bbf7d0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.commerce-product-variation__pricing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #16a34a;
}

.commerce-product-variation__list-price {
  margin-bottom: 0.75rem;
}

.price-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.price-amount--list {
  font-size: 1.25rem;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 500;
  display: block;
  opacity: 0.7;
}

.commerce-product-variation__price {
  margin-top: 1rem;
}

.price-amount--current {
  font-size: 3rem;
  font-weight: 800;
  color: #166534;
  display: block;
  line-height: 1;
  letter-spacing: -1px;
}

/* Book Type / Variation Selector */
.form-item-purchased-entity {
  margin-bottom: 1.5rem;
}

.form-item-purchased-entity label {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.625rem;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-item-purchased-entity select {
  width: 100%;
  max-width: 350px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
  color: #1f2937;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

.form-item-purchased-entity select:hover {
  border-color: #16a34a;
  background-color: #f9fafb;
}

.form-item-purchased-entity select:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
  background-color: #ffffff;
}

/* Quantity Field */
.form-item-quantity-wrapper {
  margin-bottom: 2rem;
}

.form-item-quantity-wrapper label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-item-quantity-wrapper input[type="number"] {
  width: 140px;
  padding: 1rem;
  font-size: 1.25rem;
  text-align: center;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.2s ease;
  font-weight: 700;
  color: #1f2937;
}

.form-item-quantity-wrapper input[type="number"]:hover {
  border-color: #2c5f2d;
}

.form-item-quantity-wrapper input[type="number"]:focus {
  outline: none;
  border-color: #2c5f2d;
  box-shadow: 0 0 0 4px rgba(44, 95, 45, 0.1);
}

/* Add to Cart Button - Clean Professional Style */
.form-actions-wrapper {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: none;
}

.form-actions-wrapper .form-submit,
.form-actions-wrapper button[type="submit"],
.form-actions input[type="submit"],
input.button--primary {
  background: #16a34a;
  color: #ffffff;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  max-width: 350px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
  display: block;
}

.form-actions-wrapper .form-submit:hover,
.form-actions-wrapper button[type="submit"]:hover,
input.button--primary:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.form-actions-wrapper .form-submit:active,
.form-actions-wrapper button[type="submit"]:active,
input.button--primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.25);
}

/* Additional Product Fields */
.commerce-product__field {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid #2c5f2d;
}

.commerce-product__field .field__label {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.75rem;
  display: block;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.commerce-product__field .field__item {
  color: #4b5563;
  line-height: 1.7;
  font-size: 1rem;
}

/* Hide duplicate price at bottom and empty wrappers */
.commerce-product__price,
body .commerce-price-plain:not(.commerce-product-variation__pricing *),
.commerce-product__details > .field--name-variations,
.commerce-product-variation > .field {
  display: none !important;
}

/* Hide any stray brackets or malformed wrappers */
.commerce-product__variations > div:empty,
.commerce-product__details > div:empty,
.commerce-product__details::after,
.commerce-product__details > div:not([class*="commerce"]):not([class*="form"]) {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 992px) {
  .commerce-product__wrapper {
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
  }
  
  .commerce-product__image-wrapper {
    flex: 0 0 100%;
    max-width: 100%;
    margin: 0 auto;
    max-width: 400px;
  }
  
  .commerce-product__details {
    width: 100%;
  }
  
  .commerce-product__title {
    font-size: 2rem;
  }
  
  .price-amount--current {
    font-size: 2.5rem;
  }
}

@media (max-width: 640px) {
  .commerce-product__wrapper {
    padding: 1.5rem;
  }
  
  .commerce-order-item-add-to-cart-form {
    padding: 1.5rem;
  }
  
  .commerce-product__title {
    font-size: 1.75rem;
  }
  
  .price-amount--current {
    font-size: 2.25rem;
  }
  
  .form-actions-wrapper .form-submit,
  .form-actions-wrapper button[type="submit"] {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1024px) {
  .commerce-product__image-wrapper {
    flex: 0 0 40%;
    max-width: 40%;
  }
}