/* ==========================================================================
   Content Reader — WooCommerce theme overrides
   ========================================================================== */

.cr-wc-page { padding: 32px 0 96px; }
.cr-wc-page__inner { max-width: var(--cr-max-w); margin: 0 auto; padding: 0 24px; }

/* ----- Shop / archive ------------------------------------------------ */
.cr-shop__head { margin-bottom: 40px; text-align: center; }
.cr-shop__title {
  font-size: clamp(28px, 4vw, 40px); font-weight: 800;
  background: var(--cr-grad-text); -webkit-background-clip: text; background-clip: text;
  color: transparent; margin: 8px 0 12px;
}
.cr-shop__subtitle { color: var(--cr-text-soft); margin: 0; }

.woocommerce-result-count, .woocommerce-ordering {
  font-size: 13px; color: var(--cr-text-soft);
}
.woocommerce-ordering select {
  padding: 8px 14px; border: 1px solid var(--cr-border); border-radius: var(--cr-radius-sm);
  background: var(--cr-bg-card); color: var(--cr-text); font-family: inherit; font-size: 13px;
}

/* Pricing grid layout for shop archive */
.cr-pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; max-width: 920px; margin: 0 auto;
}

/* Override WooCommerce product card */
.cr-pricing-grid .product,
.cr-pricing-grid .type-product {
  display: flex; flex-direction: column;
  background: var(--cr-bg-card);
  border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-md);
  padding: 28px; text-align: left;
  position: relative;
  transition: all 0.3s var(--cr-ease);
}
.cr-pricing-grid .product:hover { transform: translateY(-4px); box-shadow: var(--cr-shadow-md); }

.cr-pricing-grid .woocommerce-loop-product__title {
  font-family: var(--cr-font-display); font-size: 18px; font-weight: 700;
  margin: 0 0 6px; padding: 0; color: var(--cr-text);
}
.cr-pricing-grid .price {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 32px; margin: 12px 0 20px;
  font-family: var(--cr-font-display); font-weight: 800;
}
.cr-pricing-grid .price del { color: var(--cr-text-faint); font-size: 18px; margin-right: 6px; }
.cr-pricing-grid .price ins { color: var(--cr-text); background: none; text-decoration: none; }

.cr-pricing-grid .product > a img { display: none; }
.cr-pricing-grid .attachment-shop_catalog { display: none; }

.cr-pricing-grid .button,
.cr-pricing-grid .product_type_simple,
.cr-pricing-grid .product_type_subscription {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--cr-radius-sm);
  background: var(--cr-grad); color: #fff !important;
  font-weight: 600; font-size: 14px; text-decoration: none;
  margin-top: auto;
  transition: all 0.2s var(--cr-ease);
}
.cr-pricing-grid .button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45); color: #fff !important; }
.cr-pricing-grid .added_to_cart { display: none; }

/* ----- Single product ------------------------------------------------ */
.cr-product {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  align-items: start;
  padding: 24px 0 0;
}
.cr-product__visual {
  background: var(--cr-bg-card); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-md); padding: 32px;
  box-shadow: var(--cr-shadow);
}
.cr-product__visual img { width: 100%; border-radius: var(--cr-radius-sm); }
.cr-product__visual-fallback {
  display: grid; place-items: center;
  aspect-ratio: 4/3;
  background: var(--cr-grad-soft);
  border-radius: var(--cr-radius-sm);
}
.cr-product__visual-fallback svg { width: 80px; height: 80px; color: var(--cr-primary); }

.cr-product__features {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: flex; flex-direction: column; gap: 10px;
}
.cr-product__features li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px; color: var(--cr-text-soft);
}

.cr-product__info { padding-top: 12px; }
.cr-product__title { font-size: 36px; margin: 0 0 10px; }
.cr-product__price {
  font-size: 36px; font-family: var(--cr-font-display); font-weight: 800;
  margin: 0 0 20px;
  color: var(--cr-text);
}
.cr-product__price .amount { color: var(--cr-text); }
.cr-product__price del { color: var(--cr-text-faint); font-size: 22px; }
.cr-product__desc { color: var(--cr-text-soft); margin: 0 0 20px; }

.cr-product__meta {
  list-style: none; padding: 0; margin: 24px 0 0;
  border-top: 1px solid var(--cr-border-soft);
  display: flex; flex-direction: column;
}
.cr-product__meta li {
  display: flex; justify-content: space-between; padding: 12px 0;
  font-size: 14px; border-bottom: 1px solid var(--cr-border-soft);
}
.cr-product__meta li:last-child { border-bottom: 0; }
.cr-product__meta span { color: var(--cr-text-soft); }

/* ----- Cart ---------------------------------------------------------- */
.cr-cart__head { margin-bottom: 24px; }
.cr-cart__title { font-size: 28px; margin: 0; }

.shop_table.cart {
  width: 100%; border-collapse: collapse;
  background: var(--cr-bg-card); border-radius: var(--cr-radius-md);
  overflow: hidden;
}
.shop_table.cart th {
  text-align: left; padding: 14px 16px;
  background: var(--cr-bg-soft);
  font-family: var(--cr-font-display); font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cr-text-faint);
}
.shop_table.cart td {
  padding: 16px; border-bottom: 1px solid var(--cr-border-soft);
  vertical-align: middle;
}
.shop_table.cart .product-thumbnail img { width: 56px; height: 56px; border-radius: var(--cr-radius-sm); }
.shop_table.cart .product-name a { color: var(--cr-text); font-weight: 600; }
.shop_table.cart .remove {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--cr-bg-soft); color: var(--cr-text-faint) !important;
  font-size: 18px; line-height: 1;
}
.shop_table.cart .remove:hover { background: rgba(239, 68, 68, 0.1); color: #DC2626 !important; }

.cart .coupon { display: flex; gap: 8px; margin: 16px 0; }
.cart .coupon .input-text {
  padding: 8px 14px; background: var(--cr-bg); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-sm); font-family: inherit;
}

.cart-collaterals { margin-top: 32px; }
.cart_totals h2 {
  font-size: 20px; margin: 0 0 16px;
}
.cart_totals .shop_table {
  width: 100%; border-collapse: collapse;
  background: var(--cr-bg-card); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-md); overflow: hidden;
}
.cart_totals .shop_table td, .cart_totals .shop_table th {
  padding: 14px 16px; border-bottom: 1px solid var(--cr-border-soft);
  text-align: right;
}
.cart_totals .shop_table th { text-align: left; color: var(--cr-text-soft); font-weight: 500; }
.checkout-button {
  display: inline-flex; padding: 12px 24px;
  background: var(--cr-grad); color: #fff !important;
  border-radius: var(--cr-radius-sm); font-weight: 600; text-decoration: none !important;
}

/* ----- Checkout ------------------------------------------------------ */
.cr-checkout__head { margin-bottom: 32px; text-align: center; }
.cr-checkout__title { font-size: 32px; margin: 0 0 8px; }
.cr-checkout__subtitle { color: var(--cr-text-soft); margin: 0; }

.cr-checkout__summary {
  background: var(--cr-bg-card); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-md); padding: 24px;
  margin-bottom: 24px;
}
.cr-checkout__summary-title { font-size: 18px; margin: 0 0 16px; }
.cr-checkout__summary-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--cr-border-soft);
}
.cr-checkout__summary-item:last-of-type { border-bottom: 0; }
.cr-checkout__summary-thumb img { width: 56px; height: 56px; border-radius: var(--cr-radius-sm); }
.cr-checkout__summary-info { display: flex; flex-direction: column; gap: 2px; }
.cr-checkout__summary-name { font-weight: 600; }
.cr-checkout__summary-price { font-size: 14px; color: var(--cr-text-soft); }
.cr-checkout__summary-list { list-style: none; padding: 0; margin: 16px 0; }
.cr-checkout__summary-list li {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 14px;
}
.cr-checkout__secure {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--cr-text-soft);
  padding-top: 16px; border-top: 1px solid var(--cr-border-soft);
}
.cr-checkout__secure svg { width: 18px; height: 18px; color: var(--cr-primary); }

.cr-checkout__login {
  background: var(--cr-grad-soft); border-radius: var(--cr-radius-sm);
  padding: 12px 16px; margin-bottom: 16px;
  font-size: 14px;
}

.cr-checkout-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px;
  align-items: start;
}
.cr-order-review-title {
  font-size: 18px; margin: 0 0 16px;
}

#order_review {
  background: var(--cr-bg-card); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-md); padding: 24px;
}
#order_review .shop_table { width: 100%; border-collapse: collapse; }
#order_review .shop_table th, #order_review .shop_table td {
  padding: 8px 0; text-align: right; border-bottom: 1px solid var(--cr-border-soft);
  font-size: 14px;
}
#order_review .shop_table th { text-align: left; color: var(--cr-text-soft); font-weight: 500; }
#order_review .shop_table .order_total td, #order_review .shop_table .order_total th {
  font-size: 16px; font-weight: 700; padding-top: 14px;
}

#payment {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--cr-border-soft);
}
#payment .wc_payment_methods { list-style: none; padding: 0; margin: 0 0 16px; }
#payment .wc_payment_method {
  padding: 12px 0; border-bottom: 1px solid var(--cr-border-soft);
}
#payment label { font-weight: 600; font-size: 14px; cursor: pointer; }
#payment input[type="radio"] { margin-right: 8px; accent-color: var(--cr-primary); }
#payment .payment_box {
  margin-top: 8px; padding: 12px; background: var(--cr-bg-soft);
  border-radius: var(--cr-radius-sm); font-size: 14px; color: var(--cr-text-soft);
}
#place_order {
  width: 100%; padding: 14px 24px;
  background: var(--cr-grad); color: #fff; border: 0; border-radius: var(--cr-radius-sm);
  font-weight: 600; font-size: 15px; cursor: pointer;
  margin-top: 16px;
  transition: all 0.2s var(--cr-ease);
}
#place_order:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45); }

/* Billing fields */
.cr-checkout-customer .form-row {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px;
}
.cr-checkout-customer .form-row-first, .cr-checkout-customer .form-row-last {
  width: 100%; display: inline-block;
}
.cr-checkout-customer .form-row-first + .form-row-last {
  display: inline-block;
}
.cr-checkout-customer label { font-size: 13px; font-weight: 600; }
.cr-checkout-customer .input-text, .cr-checkout-customer select {
  padding: 11px 14px; background: var(--cr-bg); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-sm); font-family: inherit; font-size: 14px;
  width: 100%;
}
.cr-checkout-customer .input-text:focus {
  outline: none; border-color: var(--cr-primary); box-shadow: var(--cr-shadow-glow);
}

/* ----- My account --------------------------------------------------- */
.woocommerce-MyAccount-navigation ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.woocommerce-MyAccount-navigation ul li a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; color: var(--cr-text-soft);
  border-radius: var(--cr-radius-sm);
  font-size: 14px; font-weight: 500;
  transition: all 0.2s var(--cr-ease);
}
.woocommerce-MyAccount-navigation ul li a:hover { background: var(--cr-grad-soft); color: var(--cr-primary); }
.woocommerce-MyAccount-navigation ul li.is-active a {
  background: var(--cr-grad-soft); color: var(--cr-primary); font-weight: 600;
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--cr-text-faint); }

.woocommerce-MyAccount-content { padding: 0; }
.woocommerce-MyAccount-content h2, .woocommerce-MyAccount-content h3 {
  font-size: 22px; margin: 0 0 16px;
}
.woocommerce-MyAccount-content table {
  width: 100%; border-collapse: collapse;
  background: var(--cr-bg-card); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-sm); overflow: hidden;
}
.woocommerce-MyAccount-content table th {
  text-align: left; padding: 12px 16px;
  background: var(--cr-bg-soft); font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cr-text-faint);
}
.woocommerce-MyAccount-content table td {
  padding: 14px 16px; border-bottom: 1px solid var(--cr-border-soft); font-size: 14px;
}
.woocommerce-MyAccount-content table tr:last-child td { border-bottom: 0; }
.woocommerce-MyAccount-content .button {
  display: inline-flex; padding: 8px 14px;
  background: var(--cr-bg-card); border: 1px solid var(--cr-border); border-radius: var(--cr-radius-sm);
  color: var(--cr-text) !important; font-weight: 600; font-size: 13px; text-decoration: none;
}
.woocommerce-MyAccount-content .button:hover { border-color: var(--cr-primary); color: var(--cr-primary) !important; }

/* ----- Thank you / order received ----------------------------------- */
.cr-thankyou-wrapper { padding: 64px 0; text-align: center; }
.cr-thankyou-success {
  display: inline-flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px; max-width: 480px; margin: 0 auto;
  background: var(--cr-bg-card); border: 1px solid var(--cr-border);
  border-radius: var(--cr-radius-lg); box-shadow: var(--cr-shadow-md);
}
.cr-thankyou-success__icon {
  display: inline-grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--cr-grad); color: #fff;
}
.cr-thankyou-success__icon svg { width: 28px; height: 28px; }
.cr-thankyou-success__title { margin: 4px 0 0; font-size: 24px; }
.cr-thankyou-success__subtitle { color: var(--cr-text-soft); margin: 0; }
.cr-thankyou-success__list {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; flex-direction: column; gap: 8px; align-self: stretch;
}
.cr-thankyou-success__list li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--cr-bg-soft);
  border-radius: var(--cr-radius-sm); font-size: 14px;
}
.cr-thankyou-success__list li::before {
  content: '✓'; color: #10B981; font-weight: 700; font-size: 18px;
}
.cr-thankyou-success__cta { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; justify-content: center; }

/* ----- Notices ------------------------------------------------------ */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .woocommerce-noreviews {
  border: 1px solid var(--cr-border) !important;
  background: var(--cr-bg-card) !important;
  border-radius: var(--cr-radius-sm);
  padding: 14px 18px !important;
  margin: 0 0 16px !important;
  box-shadow: var(--cr-shadow-sm);
  list-style: none; padding-left: 50px !important;
  position: relative;
  font-size: 14px;
}
.woocommerce-message::before, .woocommerce-info::before {
  content: 'i'; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--cr-primary); color: #fff;
  display: inline-grid; place-items: center;
  font-family: serif; font-style: italic; font-size: 14px; font-weight: 700;
}
.woocommerce-error {
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.05) !important;
  padding-left: 50px !important;
}
.woocommerce-error::before {
  content: '!'; background: #DC2626; color: #fff;
}

/* ----- Responsive --------------------------------------------------- */
@media (max-width: 768px) {
  .cr-product { grid-template-columns: 1fr; }
  .cr-checkout-grid { grid-template-columns: 1fr; }
  .shop_table.cart { display: block; }
  .shop_table.cart thead { display: none; }
  .shop_table.cart tbody, .shop_table.cart tr, .shop_table.cart th, .shop_table.cart td {
    display: block; width: 100%; padding: 8px 16px;
    border-bottom: 1px solid var(--cr-border-soft);
  }
  .shop_table.cart .product-thumbnail img { width: 48px; height: 48px; }
  .shop_table.cart .actions { text-align: right; }
  .woocommerce-MyAccount-navigation ul {
    flex-direction: row; flex-wrap: wrap; gap: 8px;
  }
  .woocommerce-MyAccount-navigation ul li a { padding: 8px 12px; font-size: 13px; }
}
