/* Zimou Express Custom Checkout Styles */
:root {
  --zimou-primary: #ff5722;
  --zimou-primary-hover: #e64a19;
  --zimou-bg: #f4f6f8;
  --zimou-white: #ffffff;
  --zimou-text: #333333;
  --zimou-border: #e0e0e0;
  --zimou-radius: 8px;
  --zimou-spacing: 16px;
}

body {
  background-color: var(--zimou-bg);
  margin: 0;
  font-family: "Tajawal", sans-serif;
  /* Setup Tajawal font in header if not present */
}

/* Header */
.zimou-checkout-header {
  background-color: var(--zimou-primary);
  color: var(--zimou-white);
  padding: 15px 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.zimou-checkout-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Wrapper */
.zimou-checkout-wrapper {
  display: flex;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
  gap: 30px;
}

/* Form Section */
.zimou-checkout-form {
  flex: 2;
  background: var(--zimou-white);
  padding: 30px;
  border-radius: var(--zimou-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.zimou-checkout-form h2 {
  margin-top: 0;
  border-bottom: 2px solid var(--zimou-bg);
  padding-bottom: 15px;
  color: var(--zimou-text);
}

.zimou-form-group {
  margin-bottom: 20px;
}

.zimou-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 0.95rem;
}

.zimou-form-group input,
.zimou-form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--zimou-border);
  border-radius: var(--zimou-radius);
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.zimou-form-group input:focus,
.zimou-form-group select:focus {
  border-color: var(--zimou-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

/* Delivery Options */
.zimou-delivery-options {
  margin-top: 20px;
  margin-bottom: 30px;
}

.zimou-delivery-options h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: var(--zimou-text);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Scrollable office list */
#zimou-office-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

#zimou-office-container::-webkit-scrollbar {
  width: 5px;
}

#zimou-office-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#zimou-office-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#zimou-office-container::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.radio-card {
  position: relative;
  cursor: pointer;
  margin-top: 15px;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 15px;
  background: #fff;
  border: 2px solid var(--zimou-border);
  border-radius: var(--zimou-radius);
  text-align: left;
  transition: all 0.3s ease;
  height: 100%;
}

.radio-card input:checked + .card-content {
  border-color: var(--zimou-primary);
  background-color: rgba(255, 87, 34, 0.05);
  color: var(--zimou-primary);
  font-weight: 700;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
}

.card-subtitle {
  font-size: 0.82rem;
  color: #777;
  margin-top: 4px;
  line-height: 1.4;
}

/* Submit Button */
.zimou-submit-btn {
  width: 100%;
  padding: 16px;
  background-color: var(--zimou-primary);
  color: white;
  border: none;
  border-radius: var(--zimou-radius);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
  margin-top: 20px;
}

.zimou-submit-btn:hover {
  background-color: var(--zimou-primary-hover);
}

.zimou-submit-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Summary Section */
.zimou-checkout-summary {
  flex: 1;
  min-width: 300px;
  background: var(--zimou-white);
  padding: 25px;
  border-radius: var(--zimou-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.zimou-cart-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--zimou-border);
}

.item-image img {
  border-radius: 6px;
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.item-details {
  flex: 1;
}

.item-name {
  margin: 0 0 5px;
  font-weight: 600;
  font-size: 0.95rem;
}

.item-qty {
  margin: 0;
  color: #777;
  font-size: 0.85rem;
}

.item-price {
  font-weight: 700;
  color: var(--zimou-primary);
}

.zimou-cart-totals {
  margin-top: 20px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.95rem;
  color: #555;
}

.total-row.total {
  border-top: 2px solid var(--zimou-border);
  margin-top: 10px;
  padding-top: 15px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--zimou-text);
}

.zimou-error {
  background-color: #ffebee;
  color: #c62828;
  padding: 10px;
  margin-top: 15px;
  border-radius: 4px;
  border: 1px solid #ef9a9a;
  font-size: 0.9rem;
}

/* Product Gallery */
.zimou-gallery {
  margin-bottom: 20px;
}

.zimou-gallery-main {
  position: relative;
  width: 100%;
  border-radius: var(--zimou-radius);
  overflow: hidden;
  background: var(--zimou-bg);
}

.gallery-slides {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--zimou-text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s;
}

.gallery-nav:hover {
  background: rgba(255, 255, 255, 1);
}

.gallery-prev {
  left: 10px;
}

.gallery-next {
  right: 10px;
}

.zimou-gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.gallery-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.gallery-thumb:hover {
  opacity: 0.85;
}

.gallery-thumb.active {
  border-color: var(--zimou-primary);
  opacity: 1;
}

/* Product Description - Full Width Centered */
.zimou-product-info-section {
  max-width: 1100px;
  margin: 0 auto 30px;
  padding: 0 20px;
}

.zimou-product-info {
  background: var(--zimou-white);
  padding: 30px;
  border-radius: var(--zimou-radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.zimou-product-block {
  margin-bottom: 15px;
}

.zimou-product-block:last-child {
  margin-bottom: 0;
}

.zimou-product-block .product-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--zimou-text);
  margin: 0 0 6px;
}

.zimou-product-block .product-price-tag {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--zimou-primary);
  margin-bottom: 12px;
}

.zimou-product-block .product-price-tag del {
  color: #999;
  font-size: 0.9rem;
  font-weight: 400;
  margin-right: 6px;
}

.zimou-product-block .product-price-tag ins {
  text-decoration: none;
}

.zimou-product-block .product-description {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #555;
}

.zimou-product-block .product-description p {
  margin: 0 0 8px;
}

.zimou-product-block .product-description ul,
.zimou-product-block .product-description ol {
  padding-left: 20px;
  margin: 8px 0;
}

.zimou-product-block .product-description li {
  margin-bottom: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .zimou-checkout-wrapper {
    flex-direction: column-reverse;
    /* Summary on top or bottom? usually form first on mobile or summary collapsed */
    /* Reference site puts form visible, summary often collapsed. Let's keep normal flow but stacking */
    flex-direction: column;
  }

  .zimou-checkout-wrapper {
    margin: 15px auto;
    padding: 0 10px;
  }

  .zimou-checkout-summary {
    order: -1;
    /* Summary on top */
    position: static;
  }
}
