/**
 * WooCommerce Cart Styles
 * 
 * Custom styles for cart page
 * 
 * @package Hygge_Child
 */

/* Cart Page Layout */
.page .entry-header {
  margin: 0;
}

.page .entry-header h1 {
  color: var(--Newest, #37584c);
  font-size: 48px;
  font-weight: 300;
  line-height: 120%; /* 57.6px */
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hygge-cart-page {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.hygge-cart-page > form {
  width: calc(100% - 424px);
}

/* Cart Items */
.hygge-cart-items {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hygge-cart-item {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--Newest, #37584c);
  background: var(--White, #fff);
  position: relative;
}

.hygge-cart-item.hygge-cart-item--membership {
  padding-bottom: 56px;
}
.hygge-cart-item.hygge-cart-item--gift-voucher {
  padding-bottom: 40px;
}

.hygge-cart-item__image {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  border: 1px solid var(--Border, #e1dcd4);
  background: lightgray 0px -6.02px / 100% 125.081% no-repeat;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hygge-cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gift Voucher Icon */
.hygge-cart-item__gift-voucher-icon {
  width: 100%;
  height: 100%;
  background: var(--Newest, #37584c);
  display: flex;
  align-items: center;
  border-radius: 4px;
  text-align: left;
}

.hygge-cart-item__gift-voucher-icon span {
  color: var(--White, #fff);
  font-family: "Plus Jakarta Sans";
  font-size: 8.348px;
  font-weight: 800;
  line-height: 100%; /* 8.348px */
  padding: 0 4px;
}

/* Membership Icon */
.hygge-cart-item__membership-icon {
  width: 100%;
  height: 100%;
  background: var(--Newest, #37584c);
  display: flex;
  align-items: center;
  border-radius: 4px;
  text-align: left;
}

.hygge-cart-item__membership-icon span {
  color: var(--White, #fff);
  font-family: "Plus Jakarta Sans";
  font-size: 8.348px;
  font-weight: 800;
  line-height: 100%;
  padding: 0 4px;
}

.hygge-cart-item__content {
  display: flex;
  align-items: center;
  gap: 16px;
  width: calc(100% - 64px);
}

.hygge-cart-item__content > div {
  width: calc(50% - 8px);
}

/* Item Data (Meta) */
.hygge-cart-item .variation,
.hygge-cart-item dl.variation {
  margin: 8px 0;
  font-size: 14px;
  line-height: 150%;
  color: #666;
}

.hygge-cart-item .variation dt,
.hygge-cart-item dl.variation dt {
  font-weight: 400;
  margin-right: 4px;
  display: inline;
}

.hygge-cart-item .variation dd,
.hygge-cart-item dl.variation dd {
  display: inline;
  margin: 0;
}

.hygge-cart-item .variation p,
.hygge-cart-item dl.variation p {
  margin: 4px 0;
}

.hygge-cart-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 0;
}

.hygge-cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hygge-cart-item__title {
  margin: 0;
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 20px;
  font-weight: 400;
  line-height: 150%; /* 30px */
}

.hygge-cart-item__title a {
  color: inherit;
  text-decoration: none;
}

.hygge-cart-item__title a:hover {
  color: var(--Newest, #37584c);
}

.hygge-cart-item__description {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 14px;
  font-style: italic;
  font-weight: 300;
  line-height: 150%; /* 21px */
  margin: 0 !important;
}

.hygge-cart-item__denomination {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 300;
  line-height: 150%; /* 24px */
  margin: 8px 0 16px !important;
}

.hygge-cart-item__services {
  list-style: none;
  padding: 0 0 0 8px !important;
  margin: -8px 0 16px !important;
}

.hygge-cart-item__services li {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 300;
  line-height: 150%; /* 24px */
  position: relative;
  padding-left: 12px;
}

.hygge-cart-item__services li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--Newest, #37584c);
  font-weight: bold;
}

.hygge-cart-item__remove {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
  margin-left: 8px;
}

.hygge-cart-item__remove:hover {
  color: #d32f2f;
}

.hygge-cart-item__details {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hygge-cart-item__details > p {
  margin: 0;
}

.hygge-cart-item--gift-voucher-denomination .hygge-cart-item__details,
.hygge-cart-item--gift-voucher-service .hygge-cart-item__details,
.hygge-cart-item--membership .hygge-cart-item__details {
  justify-content: flex-end;
}

.hygge-cart-item__price {
  display: flex;
  align-items: center;
  gap: 17px;
}

.hygge-cart-item--gift-voucher.hygge-cart-item--gift-voucher-denomination
  .hygge-cart-item__price {
  display: none;
}

.hygge-cart-item--gift-voucher.hygge-cart-item--gift-voucher-service
  .hygge-cart-item__price {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 400;
  color: var(--Black, #111);
}

/* Price in info section for membership and regular products */
.hygge-cart-item__info .hygge-cart-item__price {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 300;
  line-height: 150%; /* 24px */
}

.hygge-cart-item__price-regular {
  font-size: 12px;
  text-decoration-line: line-through;
  opacity: 0.5;
}

.hygge-cart-item__quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hygge-cart-item__quantity .quantity {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--Border, #e1dcd4);
  border-radius: 4px;
  overflow: hidden;
}

.hygge-cart-item__quantity input.qty {
  width: 60px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--Border, #e1dcd4);
  border-right: 1px solid var(--Border, #e1dcd4);
  border-radius: 0;
  padding: 8px;
  font-size: 16px;
  font-weight: 700;
  appearance: textfield;
  -moz-appearance: textfield;
}

.hygge-cart-item__quantity input.qty::-webkit-outer-spin-button,
.hygge-cart-item__quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hygge-cart-item__quantity .qty-minus,
.hygge-cart-item__quantity .qty-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 38px;
  background: var(--White, #fff);
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 400;
  color: var(--Black, #111);
  transition: background-color 0.2s ease, color 0.2s ease;
  padding: 0;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  flex-shrink: 0;
}

.hygge-cart-item__quantity .qty-minus:hover,
.hygge-cart-item__quantity .qty-plus:hover {
  background: var(--Newest, #37584c);
  color: var(--White, #fff);
}

.hygge-cart-item__quantity .qty-minus:active,
.hygge-cart-item__quantity .qty-plus:active {
  background: #2d463a;
}

.hygge-cart-item__quantity .qty-minus:disabled,
.hygge-cart-item__quantity .qty-plus:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hygge-cart-item__subtotal {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 400;
  line-height: 150%; /* 24px */
}

.hygge-cart-item__edit {
  width: 100%;
  border-radius: 0 0 8px 8px;
  background: var(--BG2, #ebe6e0);
  display: flex;
  justify-content: flex-end;
  position: absolute;
  left: 0;
  bottom: 0;
}

.hygge-btn-edit-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 150%; /* 24px */
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-skip-ink: auto;
  text-decoration-thickness: auto;
  text-underline-offset: auto;
  text-underline-position: from-font;
  background: none;
}

.hygge-btn-edit-card:focus,
.hygge-btn-edit-card:hover {
  background: none;
  color: #37584c;
}

.hygge-btn-edit-card svg {
  width: 16px;
  height: 16px;
}

.hygge-btn-edit-card br {
  display: none;
}

/* Edit Card Modal */
.hygge-edit-card-modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 24, 11, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.hygge-edit-card-modal.is-open {
  display: flex;
}

.hygge-edit-card-modal .hygge-modal__dialog {
  background: #fff;
  border-radius: 16px;
  width: min(800px, 100%);
  position: relative;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}

.hygge-edit-card-modal .hygge-modal__content {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.hygge-edit-card-modal .hygge-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #37584c;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: color 0.2s ease;
}

.hygge-edit-card-modal .hygge-modal__close:hover {
  color: #2d463a;
}

.hygge-edit-card-modal .hygge-modal__title {
  color: var(--Newest, #37584c);
  font-family: "Plus Jakarta Sans";
  font-size: 24px;
  font-weight: 300;
  line-height: 150%;
  margin: 0 0 16px;
}

.hygge-edit-card-modal .hygge-modal__description {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 300;
  line-height: 180%;
  margin: 0 0 24px;
}

.hygge-edit-card-form .form-group {
  margin-bottom: 20px;
}

.hygge-edit-card-form .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 300;
  font-family: "Source Serif 4";
  color: #111;
  font-size: 16px;
  line-height: 150%;
}

.hygge-edit-card-form .form-group input,
.hygge-edit-card-form .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  background: #fff;
  font-family: "Source Serif 4";
  border: 1px solid var(--Border, #e1dcd4);
  border-radius: 8px;
  color: #111;
  line-height: 150%;
  transition: border-color 0.2s ease;
}

.hygge-edit-card-form .form-group input:focus,
.hygge-edit-card-form .form-group textarea:focus {
  outline: none;
  border-color: var(--Newest, #37584c);
}

.hygge-edit-card-form .form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.hygge-edit-card-form .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.hygge-edit-card-form .btn {
  padding: 12px 24px;
  font-size: 16px;
  font-family: "Source Serif 4";
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.hygge-edit-card-form .btn-secondary {
  background: #fff;
  color: var(--Newest, #37584c);
  border: 1px solid var(--Border, #e1dcd4);
}

.hygge-edit-card-form .btn-secondary:hover {
  background: #f5f5f5;
}

.hygge-edit-card-form .btn-primary {
  background: var(--Newest, #37584c);
  color: #fff;
}

.hygge-edit-card-form .btn-primary:hover {
  background: #2d463a;
}

.hygge-edit-card-form .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hygge-edit-card-form .form-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: "Source Serif 4";
}

.hygge-edit-card-form .form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.hygge-edit-card-form .form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

body.hygge-modal-open {
  overflow: hidden;
}

/* Cart Actions */
.hygge-cart-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hygge-cart-actions .hygge-btn-update-cart {
  display: none !important;
}

.hygge-btn-continue-shopping {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--Newest, #37584c);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 600;
  line-height: 150%; /* 24px */
}

.hygge-btn-continue-shopping:hover {
  opacity: 0.8;
  color: var(--Newest, #37584c);
}

.hygge-btn-continue-shopping svg {
  width: 20px;
  height: 20px;
}

.hygge-btn-continue-shopping br {
  display: none;
}

.hygge-cart-coupon {
  display: none;
}

.hygge-cart-coupon input {
  flex: 1;
  max-width: 300px;
  padding: 12px 16px;
  border: 1px solid var(--Border, #e1dcd4);
  border-radius: 8px;
  font-size: 16px;
  font-family: "Source Serif 4";
}

.hygge-btn-apply-coupon,
.hygge-btn-update-cart {
  padding: 12px 24px;
  background: var(--Newest, #37584c);
  color: var(--White, #fff);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Source Serif 4";
}

.hygge-btn-apply-coupon:hover,
.hygge-btn-update-cart:hover {
  background: #2d463a;
}

/* Cart Totals */
.cart-collaterals {
  width: 100%;
  max-width: 392px;
}

.hygge-cart-totals {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 24px 24px 32px !important;
  border-radius: 16px !important;
  border: 1px solid var(--Border, #e1dcd4) !important;
  background: var(--White, #fff);
}

.hygge-cart-totals__title {
  color: var(--Black, #111);
  font-size: 24px;
  font-weight: 300;
  line-height: 150%; /* 36px */
  text-transform: uppercase;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

.hygge-cart-totals__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hygge-cart-totals__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hygge-cart-totals__total-label {
  font-size: 16px;
  font-weight: 300;
  color: var(--Black, #111);
  font-family: "Source Serif 4";
}

.hygge-cart-totals__total-amount {
  font-size: 16px;
  color: var(--Newest, #111);
  font-family: "Source Serif 4";
}

.hygge-cart-totals__total-amount strong {
  font-weight: 400;
}

.hygge-cart-totals__vat {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 300;
  line-height: 150%; /* 24px */
  margin: 0 !important;
}

.hygge-cart-totals__shipping-text {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 14px;
  font-weight: 300;
  line-height: 150%; /* 24px */
  margin: 8px 0 0 !important;
}

.hygge-cart-totals__coupon,
.hygge-cart-totals__fee,
.hygge-cart-totals__tax {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: var(--Black, #111);
}

.hygge-cart-totals__coupon-label,
.hygge-cart-totals__fee-label,
.hygge-cart-totals__tax-label {
  font-weight: 400;
}

.hygge-cart-totals__coupon-amount,
.hygge-cart-totals__fee-amount,
.hygge-cart-totals__tax-amount {
  font-weight: 600;
}

/* Checkout Button */
.hygge-cart-checkout {
  margin-top: 24px;
  padding: 0 !important;
}

.hygge-btn-checkout {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px !important;
  background: var(--Newest, #37584c) !important;
  color: var(--White, #fff) !important;
  border: none;
  border-radius: 32px;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 150% !important;
  transition: all 0.2s ease;
  font-family: "Source Serif 4";
}

.hygge-btn-checkout:hover {
  background: #2d463a !important;
  color: var(--White, #fff);
}

.hygge-btn-checkout svg {
  width: 20px;
  height: 20px;
}

.hygge-cart-checkout br {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .page .entry-header h1 {
    font-size: 32px;
    line-height: 38.4px;
  }
  .hygge-cart-item__image {
    position: absolute;
    top: 16px;
    left: 16px;
  }
  .hygge-cart-item__details > p {
    position: absolute;
    top: 16px;
    right: 16px;
  }
  .hygge-cart-item__content {
    width: 100%;
    flex-direction: column;
  }
  .hygge-cart-item__content > div {
    width: 100%;
  }
  .hygge-cart-item--gift-voucher-denomination .hygge-cart-item__details,
  .hygge-cart-item--gift-voucher-service .hygge-cart-item__details,
  .hygge-cart-item--membership .hygge-cart-item__details,
  .hygge-cart-item__details {
    justify-content: space-between;
    border-top: 1px solid #e1dcd4;
    padding-top: 16px;
  }
  .hygge-cart-item--gift-voucher-service .hygge-cart-item__details,
  .hygge-cart-item--gift-voucher-denomination .hygge-cart-item__details {
    margin-bottom: 16px;
  }
  .hygge-cart-item__header {
    margin-top: 56px;
  }
}

/* ==========================================================================
   Empty Cart Styles
   ========================================================================== */

/* Hide page title when cart is empty - Simple approach */
.woocommerce-cart .entry-header {
  display: none !important;
}

/* Show title when cart has items */
.woocommerce-cart:not(:has(.hygge-empty-cart)) .entry-header {
  display: block !important;
}

/* Fallback */
body.woocommerce-cart:has(.woocommerce > .hygge-empty-cart) .entry-header {
  display: none !important;
}

.hygge-empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 16px;
  border: 1px solid var(--Border, #e1dcd4);
  background: var(--White, #fff);
  padding: 40px 20px;
  margin: 20px auto 79px;
}

.hygge-empty-cart__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
}

.hygge-empty-cart__icon svg {
  width: 100%;
  height: 100%;
}

.hygge-empty-cart p {
  margin: 0;
}

.hygge-empty-cart__message {
  display: flex;
  flex-direction: column;
}

.hygge-empty-cart__title {
  color: var(--Black, #111);
  text-align: center;
  font-family: "Plus Jakarta Sans";
  font-size: 24px;
  font-style: normal;
  font-weight: 300;
  line-height: 150%; /* 36px */
  margin: 16px 0 8px !important;
}

.hygge-empty-cart__text {
  color: var(--Black, #111);
  font-family: "Source Serif 4";
  font-size: 16px;
  font-weight: 300;
  line-height: 180%;
  margin: 0 !important;
}

.hygge-empty-cart__actions {
  margin-top: 24px;
}

.hygge-btn-shop {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 32px !important;
  background: transparent !important;
  color: var(--Newest, #37584c) !important;
  border: 1px solid var(--Newest, #37584c) !important;
  border-radius: 32px;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 150% !important;
  transition: all 0.3s ease;
  font-family: "Source Serif 4" !important;
  cursor: pointer;
  text-decoration: none !important;
}

.hygge-btn-shop:hover {
  background: var(--Newest, #37584c) !important;
  color: #fff !important;
}

.hygge-btn-shop:hover svg path {
  fill: #fff;
}

.hygge-empty-cart__actions .hygge-btn-shop {
  height: 56px;
}

.hygge-empty-cart__actions .hygge-btn-shop br {
  display: none;
}

.hygge-btn-shop svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Hide default WooCommerce empty cart message */
.wc-empty-cart-message {
  display: none !important;
}

@media (max-width: 768px) {
  .hygge-empty-cart {
    margin: 40px auto;
    padding: 40px 20px;
  }

  .hygge-empty-cart__title {
    font-size: 20px;
  }

  .hygge-empty-cart__text {
    font-size: 14px;
  }

  .hygge-cart-page > form {
    width: 100%;
  }

  .cart-collaterals {
    max-width: inherit;
  }

  .hygge-cart-actions {
    display: none;
  }
}

/* Remove empty p tags that cause layout issues */
.hygge-cart-page p:empty,
.hygge-cart-checkout p:empty,
.hygge-cart-item__meta p:empty,
.cart_totals p:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  line-height: 0 !important;
  visibility: hidden !important;
}

/* Remove p tags that only contain whitespace */
.hygge-cart-page p:only-child:empty,
.hygge-cart-checkout p:only-child:empty {
  display: none !important;
}
