/**
 * Cart Page Styles - Card Layout
 */

/* Cart Form */
.mbn-cart-form {
  max-width: 1200px;
  margin: 0 auto;
}

/* Cart Items Container */
.mbn-cart-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

/* Individual Cart Item Card */
.mbn-cart-item {
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border-radius: 16px;
  transition: box-shadow 0.3s ease;
  overflow: hidden;
  width: 100%;
}

/* .mbn-cart-item:hover {
  box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.17);
} */

/* Group wrapper: parent card + its addon wrappers */
.mbn-cart-item-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

/* Addon Product Wrapper */
.mbn-cart-item-addon-wrapper {
  width: 80%;
  align-self: flex-end;
  position: relative;
  margin-top: 20px;
}

/* Connecting line for all addon wrappers: full vertical line through the card + gap below */
.mbn-cart-item-addon-wrapper::before {
  content: "";
  position: absolute;
  left: -74px;
  top: -20px;
  width: 50px;
  bottom: 0px;
  border-left: 1px dashed #bdbdbd;
}

/* Horizontal leg for intermediate addons (not last child) */
.mbn-cart-item-addon-wrapper:not(:last-child)::after {
  content: "";
  position: absolute;
  left: -74px;
  top: 50%;
  width: 50px;
  border-top: 1px dashed #bdbdbd;
}

/* Last addon: stop vertical line midway and add the horizontal leg in one pseudo-element */
.mbn-cart-item-addon-wrapper:last-child::before {
  bottom: auto;
  height: calc(50% + 20px); /* 50% of card + the gap above */
  border-bottom: 1px dashed #bdbdbd;
}

/* Addon Product Styling */
.mbn-cart-item-addon {
  margin-bottom: 0;
}

/* Addon Parent Info */
.mbn-cart-addon-parent-info {
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 0;
  margin-top: -8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mbn-addon-label {
  color: #03233c;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mbn-addon-parent-product {
  color: #555;
  font-weight: 500;
}

.mbn-addon-parent-size {
  color: #999;
  font-size: 12px;
  font-weight: normal;
}

.mbn-addon-parent-location {
  color: #777;
  font-style: italic;
  font-size: 12px;
}

/* Top Row: Actions Bar */
.mbn-cart-item-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px;
  background: #eaeaea;
}

/* Bottom Row: Content Area */
.mbn-cart-item-content {
  display: flex;
  gap: 16px;
  padding: 16px;
}

/* Left Column: Product Image */
.mbn-cart-item-image {
  flex: 1 1 auto;
  min-width: 0;
}

.mbn-cart-item-image img {
  width: 100%;
  height: auto;
  border-radius: 16px !important;
  display: block;
}

.mbn-cart-item-image a {
  display: block;
}

/* Right Column: Product Details */
.mbn-cart-item-details {
  flex: 0 0 75%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0; /* Allows flex children to shrink */
  padding-top: 16px;
}

/* Product Title */
.mbn-cart-item-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
  padding-bottom: 16px;
  border-bottom: 1px dotted #d0d0d0;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.mbn-cart-item-title-thumbnail {
  display: none; /* Hidden by default, shown only on mobile */
  flex: 0 1 104px;
  min-width: 60px;
  max-width: 104px;
  margin-right: 12px;
}

.mbn-cart-item-title-thumbnail img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px !important;
  display: block;
}

.mbn-cart-item-title-text {
  flex: 0 1 auto;
  min-width: 0;
  font-family: "Jost", Sans-serif !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.3em !important;
  display: inline;
}

/* Product Subtitle */
.mbn-cart-item-subtitle {
  font-size: 14px;
  color: #666;
  font-family: "Golos Text", Sans-serif !important;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.mbn-subtitle-content {
  flex: 1;
  min-width: 0;
  padding-top: 5px;
}

.mbn-subtitle-location {
  color: #03233c;
  font-weight: 500;
}

.mbn-subtitle-size {
  color: #888;
  white-space: nowrap;
  margin-left: 6px;
  display: inline;
  font-family: "Jost", Sans-serif !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.3em !important;
}

/* Action Buttons in Top Bar */
.mbn-cart-item-actions-bar a {
  font-family: "Jost", Sans-serif !important;
  color: #03233c !important;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1em !important;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.mbn-cart-item-actions-bar a svg {
  width: 21px;
  height: 21px;
  fill: #03233c;
  transition: fill 0.2s ease;
}

.mbn-cart-item-actions-bar a:hover {
  color: #1c74bf !important;
}

.mbn-cart-item-actions-bar a:hover svg {
  fill: #1c74bf;
}

.mbn-cart-action-separator {
  color: #ccc;
  user-select: none;
}

/* Section Styling */
.mbn-cart-item-section {
  padding-bottom: 16px;
}

.mbn-cart-item-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.mbn-cart-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Golos Text", Sans-serif !important;
  margin: 0 0 12px 0;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #03233c !important;
}

.mbn-cart-section-title svg,
.mbn-cart-section-title .mbn-section-icon {
  width: 14px;
  height: 14px;
  fill: #4d4d4c;
  flex-shrink: 0;
}

/* Color Section */
.mbn-cart-color-value {
  font-size: 14px;
  line-height: 1.8;
  color: #555;
  font-weight: 500;
}

.mbn-cart-color-swatch {
  width: 50px;
  height: 50px !important;
  object-fit: cover;
  border: 1px solid #d6d6d6 !important;
  border-radius: 4px !important;
  vertical-align: middle;
  margin-right: 8px;
}

/* Setup Section: Specifications */
.mbn-cart-item-specs {
  font-size: 13px;
  line-height: 1.4em;
  color: #03233c;
  font-family: "Golos Text", Sans-serif !important;
}

.mbn-cart-item-specs dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mbn-cart-item-specs dl > div {
  display: block;
}

.mbn-cart-item-specs dt {
  display: inline;
  font-weight: bolder;
}

.mbn-cart-item-specs dd {
  display: inline;
  margin: 0;
}

.mbn-cart-item-specs p {
  margin: 0 0 8px 0;
}

.mbn-cart-item-specs p:last-child {
  margin-bottom: 0;
}

/* Room Location Section */
.mbn-cart-room-section {
  padding-bottom: 20px;
}

.mbn-cart-room-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mbn-cart-room-field {
  width: 100%;
  padding: 1px;
}

.mbn-cart-field-hidden {
  display: none;
}

.mbn-cart-room-number-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mbn-cart-room-number-prefix {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.mbn-cart-room-select,
.mbn-cart-room-other,
.mbn-cart-room-number,
.mbn-cart-room-notes {
  width: 100%;
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.mbn-cart-room-number {
  width: 70px;
  text-align: center;
  padding: 14px 8px !important;
}

.mbn-cart-room-other,
.mbn-cart-room-notes {
  padding: 14px !important;
}

.mbn-cart-room-select:hover,
.mbn-cart-room-other:hover,
.mbn-cart-room-number:hover,
.mbn-cart-room-notes:hover {
  border-color: #b0b0b0 !important;
}

.mbn-cart-room-select:focus,
.mbn-cart-room-other:focus,
.mbn-cart-room-number:focus,
.mbn-cart-room-notes:focus {
  outline: none;
  border-color: #1b74c0 !important;
  box-shadow: 0 0 0 1px rgba(27, 116, 192, 0.2);
}

.mbn-cart-room-other::placeholder,
.mbn-cart-room-notes::placeholder {
  color: #999;
  font-style: italic;
}

/* Accordion Toggle Link */
.mbn-cart-item-subtitle button.mbn-cart-accordion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "Golos Text", Sans-serif !important;
  font-size: 13px;
  font-weight: 400;
  color: #03233c;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: 1px solid transparent;
  padding: 5px;
  flex-shrink: 0;
  outline: none;
}

.mbn-cart-item-subtitle button.mbn-cart-accordion-toggle:hover {
  color: #1c74bf;
  border: 1px solid transparent;
}

.mbn-cart-item-subtitle button.mbn-cart-accordion-toggle:focus {
  color: #1c74bf;
  border: 1px solid transparent;
  outline: none;
}

.mbn-cart-item-subtitle button.mbn-cart-accordion-toggle .mbn-accordion-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.mbn-cart-item-subtitle
  button.mbn-cart-accordion-toggle[aria-expanded="true"]
  .mbn-accordion-icon {
  transform: rotate(180deg);
}

/* Accordion Content */
.mbn-cart-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease-out,
    padding 0.3s ease-out,
    margin 0.3s ease-out,
    opacity 0.3s ease-out;
  opacity: 0;
  padding-top: 0;
  margin-top: 0;
  border-top: 1px dotted transparent;
}

.mbn-cart-accordion-content.is-open {
  max-height: 1000px;
  opacity: 1;
  padding-top: 16px;
  border-top-color: #d0d0d0;
  transition:
    max-height 0.4s ease-in,
    padding 0.3s ease-in,
    margin 0.3s ease-in,
    opacity 0.3s ease-in;
}

/* Footer: Price, Quantity, Subtotal */
.mbn-cart-item-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.mbn-cart-item-price,
.mbn-cart-item-quantity,
.mbn-cart-item-subtotal {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mbn-cart-footer-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mbn-cart-footer-value {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.mbn-cart-item-price .mbn-cart-footer-value {
  color: #0066cc;
}

.mbn-cart-item-subtotal .mbn-cart-footer-value {
  color: #0066cc;
  font-size: 20px;
}

/* Quantity Input Styling */
.mbn-cart-item-quantity .quantity {
  margin: 0;
}

.mbn-cart-item-quantity input.qty {
  width: 70px;
  padding: 8px 12px;
  border: 2px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.3s ease;
}

.mbn-cart-item-quantity input.qty:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.mbn-quantity-locked {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  color: #999;
}

/* Cart Actions */
.mbn-cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px;
  background: #f8f8f8;
  border-radius: 8px;
  margin-bottom: 30px;
}

.mbn-cart-actions .coupon {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 300px;
}

.mbn-cart-actions .coupon input {
  flex: 1;
  max-width: 200px;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.mbn-cart-actions button[name="update_cart"],
.mbn-cart-actions button[name="apply_coupon"] {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Adjacency Section */
.mbn-cart-adjacency-output {
  padding-bottom: 16px;
}

.mbn-cart-adjacency-field {
  margin-top: 8px;
  padding: 1px;
}

.mbn-cart-adjacency-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4em;
  color: #03233c;
  font-family: "Golos Text", Sans-serif !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.mbn-cart-adjacency-select:hover {
  border-color: #b0b0b0 !important;
}

.mbn-cart-adjacency-select:focus {
  outline: none;
  border-color: #1b74c0 !important;
  box-shadow: 0 0 0 1px rgba(27, 116, 192, 0.2);
}

/* Backorder Notification */
.backorder_notification {
  margin: 8px 0 0 0;
  padding: 8px 12px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  font-size: 13px;
  color: #856404;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .mbn-cart-item-details {
    flex: 0 0 70%;
  }

  .mbn-cart-item-footer {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  /* Hide the left column image */
  .mbn-cart-item-image {
    display: none;
  }

  /* Show inline thumbnail in title and make details full width */
  .mbn-cart-item-details {
    flex: 0 0 100%;
  }

  .mbn-cart-item-title-thumbnail {
    display: block;
  }

  .mbn-cart-item-actions-bar {
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  .mbn-cart-room-fields {
    grid-template-columns: 1fr;
  }

  .mbn-cart-item-footer {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .mbn-cart-footer-value {
    font-size: 16px;
  }

  .mbn-cart-item-subtotal .mbn-cart-footer-value {
    font-size: 18px;
  }

  .mbn-cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mbn-cart-actions .coupon {
    min-width: auto;
    width: 100%;
  }

  .mbn-cart-actions button {
    width: 100%;
  }

  /* Reduce addon indentation on mobile */
  .mbn-cart-item-addon-wrapper {
    width: 90%;
  }

  .mbn-cart-item-addon-wrapper::before {
    left: -28px;
    width: 20px;
  }

  .mbn-cart-item-addon-wrapper:not(:last-child)::after {
    left: -28px;
    width: 20px;
  }

  .mbn-cart-item-addon-wrapper:last-child::before {
    bottom: auto;
    height: calc(50% + 20px);
  }
}

/* Validation Notice */
.mbn-cart-validation-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 20px 0;
  background-color: #e8f4fd;
  border: 1px solid #1b74c0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #03233c;
  font-family: "Golos Text", Sans-serif !important;
}

.mbn-cart-validation-notice .mbn-notice-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: #1b74c0;
}

.mbn-cart-validation-notice .mbn-notice-text {
  flex: 1;
}

/* Free shipping description */
.woocommerce-cart .woocommerce-shipping-totals td::before {
  display: none;
}

.woocommerce-cart .woocommerce-shipping-totals label {
  color: #03233c !important;
}

.woocommerce-checkout .woocommerce-shipping-totals th {
  display: none;
}

.woocommerce-checkout .woocommerce-shipping-totals td {
  padding-top: 30px !important;
}

.mbn-free-shipping-description,
.mbn-free-shipping-description p {
  font-size: 0.85em;
  color: #666;
  font-weight: normal;
  margin: 0;
}

/* Confirmation Checkbox */
.mbn-cart-confirmation {
  margin: 20px 0;
}

.mbn-cart-confirmation-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #03233c;
  cursor: pointer;
}

.mbn-cart-confirm-checkbox {
  margin-top: 6px;
}

.mbn-cart-confirmation abbr.required {
  color: #cc0000;
  text-decoration: none;
  border: none;
}

.mbn-cart-confirmation-notice {
  margin-top: 10px;
}
