/* Cart Page Styling */

/* Ensure minimum height and proper footer positioning */
.cart-main {
  min-height: calc(100vh - 120px); /* Adjust based on header height */
  display: flex;
  flex-direction: column;
  background: var(--naf-bg-default);
}

.cart-main .container {
  flex: 1;
}

/* Hide WooCommerce cart notices (like "product added" messages) */
.woocommerce-cart .woocommerce-notices-wrapper {
  display: none !important;
}

.woocommerce-cart .woocommerce-message {
  display: none !important;
}

/* Cart Header for Non-Empty Cart */
.cart-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.cart-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--naf-gray-900);
  margin-bottom: 0.5rem;
}

.cart-subtitle {
  font-size: 1rem;
  color: var(--naf-gray-600);
  margin: 0;
}

/* Empty Cart Styling */
.empty-cart-container {
  min-height: 70vh;
  padding: 3rem 0;
}

.empty-cart-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.empty-cart-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--naf-primary-50) 0%, white 100%);
  border-radius: 1rem;
  border: 1px solid var(--naf-gray-200);
  box-shadow: var(--naf-shadow);
  height: 100%;
}

.empty-cart-icon {
  margin-bottom: 2rem;
}

.empty-cart-icon i {
  font-size: 5rem;
  color: var(--naf-primary);
  opacity: 0.8;
}

.empty-cart-message {
  margin-bottom: 2rem;
}

.empty-cart-message h2 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--naf-gray-900);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.empty-cart-message p {
  font-size: 1.125rem;
  color: var(--naf-gray-600);
  line-height: 1.6;
  margin-bottom: 0;
  max-width: 400px;
}

.empty-cart-actions {
  margin-bottom: 0;
}

.empty-cart-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.empty-cart-actions .btn i {
  font-size: 0.875rem;
}

/* Popular Products Section */
.empty-cart-right {
  padding: 0;
}

.popular-products-section {
  background-color: white;
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--naf-gray-200);
  box-shadow: var(--naf-shadow);
  height: 100%;
}

.popular-products-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--naf-gray-900);
  margin-bottom: 2rem;
  text-align: center;
}

.popular-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.popular-product-item {
  background-color: var(--naf-gray-50);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
  border: 1px solid var(--naf-gray-200);
  padding: 1rem;
}

.popular-product-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--naf-shadow-lg);
  border-color: var(--naf-primary);
}

.popular-product-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.popular-product-image {
  width: 80px;
  height: 80px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 0.5rem;
  flex-shrink: 0;
  border: 1px solid var(--naf-gray-200);
}

.popular-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.popular-product-item:hover .popular-product-image img {
  transform: scale(1.05);
}

.popular-product-details {
  flex: 1;
}

.popular-product-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--naf-gray-900);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-product-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--naf-primary);
}

/* Cart with Items Styling */
.woocommerce-cart-form {
  margin-top: 0 !important;
}

.cart-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: flex-start;
  margin-top: 1rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 992px) {
  .cart-content {
    grid-template-columns: 2.2fr 1fr;
  }
}

/* Cart Items List */
.cart-items-list {
  background: transparent;
}

/* Compact Row Layout */
.cart-item-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--naf-primary-600);
  align-items: flex-start;
  position: relative;
}

.cart-item-row:last-child {
  border-bottom: none;
}

/* Product Image */
.item-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--naf-primary);
  box-shadow: 0 1px 4px rgba(197, 164, 92, 0.1);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Product Details */
.item-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--naf-gray-900);
  line-height: 1.3;
  text-transform: uppercase;
}

.item-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.item-link:hover {
  color: var(--naf-primary);
}

.item-price {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--naf-gray-900);
}

.item-meta {
  font-size: 0.875rem;
  color: var(--naf-gray-600);
}
.wcpa_cart_meta {
  padding-left: 0;
}

/* Product info container for title and price */
.product-info-main {
}

/* Quantity Section - Under product details */
.item-quantity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.quantity-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--naf-gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

/* Remove Button - Top right corner */
.item-remove {
  position: absolute;
  top: 1rem;
  right: 0;
}

.remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  color: var(--naf-primary) !important;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 1.25rem;
  font-weight: 300;
}

.remove-btn:hover {
  color: var(--naf-primary-600) !important;
  transform: scale(1.1);
}

/* Quantity Controls - Clean Design */
.quantity-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--naf-gray-300);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--naf-gray-50);
  color: var(--naf-gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.qty-btn:hover:not(:disabled) {
  background: var(--naf-primary);
  color: white;
}

.qty-btn:disabled,
.qty-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--naf-gray-400);
}

.qty-input {
  width: 60px;
  text-align: center;
  border: 1px solid var(--naf-gray-300);
  border-radius: 4px;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 500;
  background: white;
  color: var(--naf-gray-900);
  /* Hide native number input controls */
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

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

.qty-input:focus {
  outline: none;
  border-color: var(--naf-primary);
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.1);
}

.cart-collaterals {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(11, 27, 63, 0.06);
  padding: 2rem 2rem 1.5rem 2rem;
  min-width: 270px;
  height: fit-content;
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
}

/* Coupon Section */
.cart-coupon-section {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--naf-gray-200);
}

.cart-coupon-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--naf-gray-900);
  margin-bottom: 0.5rem;
}

.coupon-description {
  font-size: 0.875rem;
  color: var(--naf-gray-600);
  margin-bottom: 1rem;
}

.coupon-form {
  display: flex;
  gap: 0.5rem;
}

.coupon-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--naf-gray-300);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.coupon-input:focus {
  outline: none;
  border-color: var(--naf-primary);
  box-shadow: 0 0 0 2px rgba(197, 164, 92, 0.2);
}

.coupon-input::placeholder {
  color: var(--naf-gray-400);
}

.coupon-btn {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coupon-btn i {
  font-size: 0.75rem;
}

/* WooCommerce Cart Totals */
.woocommerce-cart .cart_totals h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--naf-text-primary);
  margin-bottom: 1.2rem;
}

.woocommerce-cart .cart_totals table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  margin-bottom: 1.5rem;
}

.woocommerce-cart .cart_totals th,
.woocommerce-cart .cart_totals td {
  font-size: 1rem;
  color: var(--naf-text-primary);
  padding: 0.2rem 0;
  background: none;
  border: none;
}

.woocommerce-cart .cart_totals .order-total th,
.woocommerce-cart .cart_totals .order-total td {
  font-weight: 700;
  color: var(--naf-primary);
  font-size: 1.08rem;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  display: block;
  width: 100%;
  background: var(--naf-primary);
  color: #fff;
  font-weight: 600;
  font-size: 1.08rem;
  padding: 0.95rem 0;
  border-radius: 8px;
  text-align: center;
  margin-top: 0.5rem;
  transition: background 0.2s;
  box-shadow: 0 1px 4px rgba(197, 164, 92, 0.08);
  text-decoration: none !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--naf-primary-dark);
  color: #fff;
}

/* WooCommerce Update Cart Button */
.woocommerce-cart .woocommerce-cart-form button[name="update_cart"].button {
  background-color: var(--naf-primary);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-transform: none;
  font-size: inherit;
}

.woocommerce-cart
  .woocommerce-cart-form
  button[name="update_cart"].button:hover {
  background-color: var(--naf-primary-dark);
  color: #ffffff;
}

/* Hide default page title and edit link on Cart page */
body.woocommerce-cart .entry-header,
body.woocommerce-cart footer.entry-footer {
  display: none;
}

/* Cart item header: flex for title and remove button */
.cart-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cart-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cart-collaterals {
    position: static;
  }

  /* Mobile Compact Layout */
  .cart-item-row {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding: 1.5rem 0;
  }

  .item-image {
    width: 80px;
    height: 80px;
  }

  .item-details {
    gap: 0.5rem;
  }

  .item-title {
    font-size: 1.125rem;
  }

  .item-remove {
    top: 0.75rem;
    right: 0;
  }
}

@media (max-width: 600px) {
  .cart-content {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .cart-items,
  .cart-collaterals {
    padding: 1.1rem 0.7rem 1.1rem 0.7rem;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(11, 27, 63, 0.07);
  }
  .cart-item {
    grid-template-columns: 60px 1fr;
    gap: 0.7rem;
    padding: 0.8rem 0;
  }
  .cart-item__image img {
    width: 54px;
    height: 54px;
  }
  .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    font-size: 1rem;
    padding: 0.8rem 0;
  }

  .empty-cart-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }

  .empty-cart-left {
    padding: 2rem 1.5rem;
  }

  .empty-cart-icon i {
    font-size: 4rem;
  }

  .empty-cart-message h2 {
    font-size: 1.75rem;
  }

  .empty-cart-message p {
    font-size: 1rem;
  }

  .popular-products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .popular-product-link {
    flex-direction: row;
    gap: 0.75rem;
  }

  .popular-product-image {
    width: 60px;
    height: 60px;
  }

  .popular-product-title {
    font-size: 0.875rem;
  }

  .popular-product-price {
    font-size: 1rem;
  }

  .cart-item {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cart-item__image {
    width: 100%;
    height: 150px;
  }

  .cart-item__header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .cart-item__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cart-item__price {
    justify-content: flex-start;
    min-width: auto;
    width: 100%;
  }

  .coupon-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .quantity-controls {
    width: 100%;
    max-width: 200px;
  }

  .cart-collaterals {
    position: static;
    gap: 1.5rem;
  }

  .cart-coupon-section {
    padding-bottom: 1.5rem;
  }
}

/* Additional WooCommerce notices hiding */
.woocommerce .woocommerce-notices-wrapper {
  display: none !important;
}

.woocommerce .woocommerce-message,
.woocommerce .woocommerce-error,
.woocommerce .woocommerce-info {
  display: none !important;
}
