/**
 * Poptides — Cart & Checkout Styles
 * Loaded on is_cart() and is_checkout() pages.
 * Scoped under .poptides-cart-page and .poptides-checkout-page.
 *
 * Branch: manus/cart-checkout-styling
 */

/* ── SHARED PAGE SHELL ──────────────────────────────────────────────────── */
.poptides-cart-page,
.poptides-checkout-page {
  font-family: 'Inter', sans-serif;
  background: #f4f3f0;
  min-height: 100vh;
  padding-top: 68px; /* navbar height */
}

.poptides-cart-page .pcp-inner,
.poptides-checkout-page .pcp-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── PAGE HEADER ────────────────────────────────────────────────────────── */
.pcp-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 36px;
}

.pcp-title {
  font-size: 32px;
  font-weight: 900;
  color: #0d1117;
  letter-spacing: -0.5px;
  margin: 0;
}

.pcp-count {
  font-size: 13px;
  font-weight: 600;
  color: #5a6080;
  background: rgba(0,0,0,0.06);
  padding: 4px 12px;
  border-radius: 50px;
}

/* ── NOTICES ────────────────────────────────────────────────────────────── */
.poptides-cart-page .woocommerce-message,
.poptides-cart-page .woocommerce-error,
.poptides-cart-page .woocommerce-info,
.poptides-checkout-page .woocommerce-message,
.poptides-checkout-page .woocommerce-error,
.poptides-checkout-page .woocommerce-info {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  border-radius: 12px !important;
  border-top: none !important;
  padding: 14px 20px !important;
  margin-bottom: 24px !important;
  background: #fff !important;
  border: 1.5px solid rgba(0,0,0,0.08) !important;
  color: #1a1a2e !important;
}

.poptides-cart-page .woocommerce-error,
.poptides-checkout-page .woocommerce-error {
  border-color: rgba(232,113,74,0.4) !important;
  background: #fdf0eb !important;
}

/* ── CART LAYOUT ────────────────────────────────────────────────────────── */
.pcp-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

/* ── CART ITEMS PANEL ───────────────────────────────────────────────────── */
.pcp-items {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.pcp-items-header {
  display: grid;
  grid-template-columns: 1fr 100px 120px 100px;
  gap: 16px;
  padding: 16px 28px;
  background: #0d1117;
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.pcp-item {
  display: grid;
  grid-template-columns: 1fr 100px 120px 100px;
  gap: 16px;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.15s;
}

.pcp-item:last-of-type {
  border-bottom: none;
}

.pcp-item:hover {
  background: #faf9f7;
}

/* Product cell */
.pcp-item-product {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pcp-item-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f4f3f0;
}

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

.pcp-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #0d1117;
  line-height: 1.3;
  margin-bottom: 4px;
}

.pcp-item-name a {
  color: inherit !important;
  text-decoration: none !important;
}

.pcp-item-name a:hover {
  color: #e8714a !important;
}

.pcp-item-stock {
  font-size: 11px;
  font-weight: 600;
  color: #5a6080;
}

.pcp-item-remove-mobile {
  display: none;
}

/* Price / qty / subtotal cells */
.pcp-item-price,
.pcp-item-subtotal {
  font-size: 15px;
  font-weight: 700;
  color: #0d1117;
  font-family: 'Inter', sans-serif;
}

.pcp-item-price .woocommerce-Price-amount,
.pcp-item-subtotal .woocommerce-Price-amount {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: #0d1117 !important;
}

.pcp-item-subtotal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quantity input */
.pcp-item-qty .quantity {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  border: 1.5px solid rgba(0,0,0,0.12) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  width: fit-content !important;
  background: #fff !important;
}

.pcp-item-qty .quantity input[type="number"] {
  width: 44px !important;
  height: 38px !important;
  text-align: center !important;
  border: none !important;
  border-left: 1.5px solid rgba(0,0,0,0.1) !important;
  border-right: 1.5px solid rgba(0,0,0,0.1) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: 'Inter', sans-serif !important;
  color: #0d1117 !important;
  background: transparent !important;
  -moz-appearance: textfield !important;
  padding: 0 !important;
  outline: none !important;
}

.pcp-item-qty .quantity input[type="number"]::-webkit-inner-spin-button,
.pcp-item-qty .quantity input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
}

/* Remove button */
.pcp-remove {
  font-size: 11px;
  font-weight: 700;
  color: #5a6080 !important;
  text-decoration: none !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.15s;
  white-space: nowrap;
}

.pcp-remove:hover {
  color: #e8714a !important;
}

.pcp-remove--desktop {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  margin-left: 4px;
}

/* Update cart row */
.pcp-update-row {
  padding: 16px 28px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #faf9f7;
}

.pcp-btn-update {
  background: transparent !important;
  color: #5a6080 !important;
  border: 1.5px solid rgba(0,0,0,0.15) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  padding: 10px 24px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  font-family: 'Inter', sans-serif !important;
  transition: border-color 0.15s, color 0.15s !important;
}

.pcp-btn-update:hover {
  border-color: #0d1117 !important;
  color: #0d1117 !important;
}

/* ── ORDER SUMMARY CARD ─────────────────────────────────────────────────── */
.pcp-summary {
  position: sticky;
  top: 88px;
}

.pcp-summary-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.pcp-summary-title {
  font-size: 18px;
  font-weight: 800;
  color: #0d1117;
  margin: 0 0 20px;
  letter-spacing: -0.3px;
}

/* WooCommerce cart totals table */
.pcp-totals .shop_table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 20px !important;
}

.pcp-totals .shop_table th,
.pcp-totals .shop_table td {
  padding: 10px 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  color: #1a1a2e !important;
}

.pcp-totals .shop_table th {
  font-weight: 600 !important;
  color: #5a6080 !important;
  text-align: left !important;
}

.pcp-totals .shop_table td {
  text-align: right !important;
  font-weight: 700 !important;
}

.pcp-totals .shop_table .order-total th,
.pcp-totals .shop_table .order-total td {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #0d1117 !important;
  border-bottom: none !important;
  padding-top: 14px !important;
}

.pcp-totals .shop_table .order-total td .woocommerce-Price-amount {
  color: #e8714a !important;
  font-size: 18px !important;
}

/* Coupon form */
.pcp-totals .coupon {
  display: flex !important;
  gap: 8px !important;
  margin-bottom: 16px !important;
}

.pcp-totals .coupon input[type="text"] {
  flex: 1 !important;
  border: 1.5px solid rgba(0,0,0,0.12) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-family: 'Inter', sans-serif !important;
  color: #0d1117 !important;
  outline: none !important;
  transition: border-color 0.15s !important;
}

.pcp-totals .coupon input[type="text"]:focus {
  border-color: #e8714a !important;
}

.pcp-totals .coupon button,
.pcp-totals .coupon .button {
  background: #0d1117 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  font-family: 'Inter', sans-serif !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
  white-space: nowrap !important;
}

.pcp-totals .coupon button:hover,
.pcp-totals .coupon .button:hover {
  background: #e8714a !important;
}

/* Checkout button */
.pcp-btn-checkout {
  display: block !important;
  width: 100% !important;
  background: #e8714a !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  text-align: center !important;
  padding: 16px 24px !important;
  border-radius: 14px !important;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
  box-shadow: 0 4px 20px rgba(232,113,74,0.35) !important;
  margin-bottom: 12px !important;
}

.pcp-btn-checkout:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px rgba(232,113,74,0.45) !important;
  color: #fff !important;
}

.pcp-btn-continue {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #5a6080 !important;
  text-decoration: none !important;
  padding: 10px !important;
  transition: color 0.15s !important;
  margin-bottom: 20px !important;
}

.pcp-btn-continue:hover {
  color: #0d1117 !important;
}

/* Trust badges */
.pcp-trust,
.pco-trust {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.pcp-trust-item,
.pco-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #5a6080;
}

.pcp-trust-item svg,
.pco-trust-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: #e8714a;
}

/* ── EMPTY CART ─────────────────────────────────────────────────────────── */
.pcp-empty {
  text-align: center;
  padding: 80px 24px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.pcp-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: #fdf0eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pcp-empty-icon svg {
  width: 32px;
  height: 32px;
  stroke: #e8714a;
}

.pcp-empty h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0d1117;
  margin: 0 0 12px;
}

.pcp-empty p {
  font-size: 15px;
  color: #5a6080;
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.pcp-empty .pcp-btn-checkout {
  display: inline-block !important;
  width: auto !important;
}

/* ── CHECKOUT LAYOUT ────────────────────────────────────────────────────── */
.pco-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}

/* ── CHECKOUT FIELDS ────────────────────────────────────────────────────── */
.pco-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pco-section {
  background: #fff;
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.pco-section-title {
  font-size: 18px;
  font-weight: 800;
  color: #0d1117;
  margin: 0 0 24px;
  letter-spacing: -0.3px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

/* WooCommerce form fields */
.poptides-checkout-page .woocommerce-input-wrapper {
  width: 100% !important;
}

.poptides-checkout-page .form-row {
  margin-bottom: 16px !important;
}

.poptides-checkout-page .form-row label {
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  color: #5a6080 !important;
  margin-bottom: 6px !important;
  display: block !important;
  font-family: 'Inter', sans-serif !important;
}

.poptides-checkout-page .form-row label abbr {
  color: #e8714a !important;
  text-decoration: none !important;
}

.poptides-checkout-page .form-row input[type="text"],
.poptides-checkout-page .form-row input[type="email"],
.poptides-checkout-page .form-row input[type="tel"],
.poptides-checkout-page .form-row input[type="number"],
.poptides-checkout-page .form-row input[type="password"],
.poptides-checkout-page .form-row textarea,
.poptides-checkout-page .form-row select,
.poptides-checkout-page .select2-container--default .select2-selection--single {
  width: 100% !important;
  border: 1.5px solid rgba(0,0,0,0.12) !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  font-family: 'Inter', sans-serif !important;
  color: #0d1117 !important;
  background: #faf9f7 !important;
  outline: none !important;
  transition: border-color 0.15s, background 0.15s !important;
  box-shadow: none !important;
  height: auto !important;
  line-height: 1.5 !important;
}

.poptides-checkout-page .form-row input:focus,
.poptides-checkout-page .form-row textarea:focus,
.poptides-checkout-page .form-row select:focus,
.poptides-checkout-page .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #e8714a !important;
  background: #fff !important;
}

.poptides-checkout-page .select2-container--default .select2-selection--single {
  display: flex !important;
  align-items: center !important;
}

.poptides-checkout-page .select2-container--default .select2-selection--single .select2-selection__rendered {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  color: #0d1117 !important;
  padding: 0 !important;
  line-height: 1.5 !important;
}

.poptides-checkout-page .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 50% !important;
  transform: translateY(-50%) !important;
  right: 12px !important;
}

/* Two-column field layout */
.poptides-checkout-page .form-row-first,
.poptides-checkout-page .form-row-last {
  width: calc(50% - 8px) !important;
  float: left !important;
}

.poptides-checkout-page .form-row-first {
  margin-right: 16px !important;
}

.poptides-checkout-page .form-row-wide {
  clear: both !important;
  width: 100% !important;
}

/* Clearfix */
.poptides-checkout-page .woocommerce-billing-fields::after,
.poptides-checkout-page .woocommerce-shipping-fields::after {
  content: '' !important;
  display: table !important;
  clear: both !important;
}

/* Checkbox */
.poptides-checkout-page .form-row input[type="checkbox"] {
  width: auto !important;
  height: auto !important;
  margin-right: 8px !important;
  accent-color: #e8714a !important;
}

/* Ship to different address toggle */
.poptides-checkout-page #ship-to-different-address label {
  font-size: 14px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #0d1117 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
}

/* ── ORDER REVIEW CARD ──────────────────────────────────────────────────── */
.pco-review {
  position: sticky;
  top: 88px;
}

.pco-review-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

/* Order review table */
.poptides-checkout-page .woocommerce-checkout-review-order-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 20px !important;
}

.poptides-checkout-page .woocommerce-checkout-review-order-table th,
.poptides-checkout-page .woocommerce-checkout-review-order-table td {
  padding: 10px 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  color: #1a1a2e !important;
  vertical-align: middle !important;
}

.poptides-checkout-page .woocommerce-checkout-review-order-table thead th {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: #5a6080 !important;
}

.poptides-checkout-page .woocommerce-checkout-review-order-table .product-name {
  font-weight: 600 !important;
}

.poptides-checkout-page .woocommerce-checkout-review-order-table .product-total {
  text-align: right !important;
  font-weight: 700 !important;
}

.poptides-checkout-page .woocommerce-checkout-review-order-table .order-total th,
.poptides-checkout-page .woocommerce-checkout-review-order-table .order-total td {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0d1117 !important;
  border-bottom: none !important;
  padding-top: 14px !important;
}

.poptides-checkout-page .woocommerce-checkout-review-order-table .order-total td .woocommerce-Price-amount {
  color: #e8714a !important;
  font-size: 17px !important;
}

/* Payment section */
.poptides-checkout-page #payment {
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.poptides-checkout-page #payment .payment_methods {
  border: none !important;
  padding: 0 !important;
  margin-bottom: 20px !important;
  list-style: none !important;
}

.poptides-checkout-page #payment .payment_methods li {
  border: 1.5px solid rgba(0,0,0,0.1) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  margin-bottom: 8px !important;
  background: #faf9f7 !important;
  transition: border-color 0.15s !important;
}

.poptides-checkout-page #payment .payment_methods li:has(input:checked) {
  border-color: #e8714a !important;
  background: #fdf0eb !important;
}

.poptides-checkout-page #payment .payment_methods li label {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #0d1117 !important;
  font-family: 'Inter', sans-serif !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.poptides-checkout-page #payment .payment_methods li input[type="radio"] {
  accent-color: #e8714a !important;
  width: 16px !important;
  height: 16px !important;
}

.poptides-checkout-page #payment .payment_box {
  background: #f4f3f0 !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  margin-top: 10px !important;
  font-size: 13px !important;
  color: #5a6080 !important;
  font-family: 'Inter', sans-serif !important;
}

/* Place order button */
.poptides-checkout-page #payment #place_order,
.poptides-checkout-page .wc-block-components-checkout-place-order-button {
  display: block !important;
  width: 100% !important;
  background: #e8714a !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  text-align: center !important;
  padding: 16px 24px !important;
  border-radius: 14px !important;
  border: none !important;
  cursor: pointer !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
  box-shadow: 0 4px 20px rgba(232,113,74,0.35) !important;
  font-family: 'Inter', sans-serif !important;
  margin-top: 16px !important;
}

.poptides-checkout-page #payment #place_order:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px rgba(232,113,74,0.45) !important;
}

/* Privacy policy text */
.poptides-checkout-page .woocommerce-privacy-policy-text {
  font-size: 11px !important;
  color: #5a6080 !important;
  text-align: center !important;
  margin-top: 12px !important;
  line-height: 1.6 !important;
  font-family: 'Inter', sans-serif !important;
}

.poptides-checkout-page .woocommerce-privacy-policy-text a {
  color: #e8714a !important;
}

/* ── BREADCRUMB OVERRIDE ────────────────────────────────────────────────── */
.poptides-cart-page .woocommerce-breadcrumb,
.poptides-checkout-page .woocommerce-breadcrumb {
  display: none !important;
}

/* ── ADMIN BAR OFFSET ───────────────────────────────────────────────────── */
body.admin-bar .poptides-cart-page,
body.admin-bar .poptides-checkout-page {
  padding-top: 100px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pcp-layout,
  .pco-layout {
    grid-template-columns: 1fr;
  }

  .pcp-summary,
  .pco-review {
    position: static;
  }

  .pcp-items-header {
    display: none;
  }

  .pcp-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  .pcp-item-price::before { content: attr(data-label) ': '; font-size: 11px; font-weight: 600; color: #5a6080; text-transform: uppercase; letter-spacing: 1px; }
  .pcp-item-qty::before   { content: attr(data-label) ': '; font-size: 11px; font-weight: 600; color: #5a6080; text-transform: uppercase; letter-spacing: 1px; }
  .pcp-item-subtotal::before { content: attr(data-label) ': '; font-size: 11px; font-weight: 600; color: #5a6080; text-transform: uppercase; letter-spacing: 1px; }

  .pcp-item-remove-mobile {
    display: block;
  }

  .pcp-remove--desktop {
    display: none;
  }

  .poptides-cart-page .pcp-inner,
  .poptides-checkout-page .pcp-inner {
    padding: 28px 16px 60px;
  }

  .pco-section {
    padding: 20px;
  }

  .poptides-checkout-page .form-row-first,
  .poptides-checkout-page .form-row-last {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 480px) {
  .pcp-title {
    font-size: 26px;
  }

  .pcp-summary-card,
  .pco-review-card {
    padding: 20px;
  }
}
