/*
 * KTB V2 - WooCommerce + WCFM commerce surfaces
 */

body.ktb-commerce-surface {
  --ktb-c-bg: #070b14;
  --ktb-c-panel: #0f1728;
  --ktb-c-panel-soft: rgba(15, 23, 40, 0.78);
  --ktb-c-border: rgba(126, 145, 181, 0.28);
  --ktb-c-text: #edf2ff;
  --ktb-c-muted: #9db1d8;
  --ktb-c-accent: #29d3c3;
  --ktb-c-accent-2: #4c7fff;
  --ktb-c-shadow: 0 24px 52px rgba(4, 9, 18, 0.5);
}

body.ktb-commerce-surface .site-content {
  background:
    radial-gradient(circle at 0 0, rgba(76, 127, 255, 0.2), transparent 35%),
    radial-gradient(circle at 100% 0, rgba(41, 211, 195, 0.16), transparent 32%),
    linear-gradient(180deg, #060913 0%, #070b14 100%);
}

body.ktb-commerce-surface .woocommerce.container {
  max-width: 1240px;
  padding: 14px clamp(14px, 3vw, 26px) 36px;
  margin: 0 auto;
}

body.ktb-commerce-surface .woocommerce form.checkout_coupon,
body.ktb-commerce-surface .woocommerce form.login,
body.ktb-commerce-surface .woocommerce form.register {
  border: 1px solid var(--ktb-c-border);
  border-radius: 16px;
  background: var(--ktb-c-panel-soft);
  box-shadow: var(--ktb-c-shadow);
}

body.ktb-commerce-surface .woocommerce-message,
body.ktb-commerce-surface .woocommerce-info,
body.ktb-commerce-surface .woocommerce-error {
  border-radius: 12px;
  border-color: rgba(41, 211, 195, 0.45);
  color: var(--ktb-c-text);
  background: rgba(11, 18, 31, 0.9);
}

body.ktb-commerce-surface .woocommerce a.button,
body.ktb-commerce-surface .woocommerce button.button,
body.ktb-commerce-surface .woocommerce input.button,
body.ktb-commerce-surface .woocommerce .button,
body.ktb-commerce-surface .wcfm_submit_button {
  border-radius: 999px;
  border: 1px solid rgba(41, 211, 195, 0.44);
  background: linear-gradient(135deg, var(--ktb-c-accent), var(--ktb-c-accent-2));
  color: #03101d !important;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

body.ktb-commerce-surface .woocommerce a.button:hover,
body.ktb-commerce-surface .woocommerce button.button:hover,
body.ktb-commerce-surface .woocommerce input.button:hover,
body.ktb-commerce-surface .woocommerce .button:hover,
body.ktb-commerce-surface .wcfm_submit_button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 14px 28px rgba(17, 170, 188, 0.3);
}

/* My Account layout and left re-balance */
body.woocommerce-account.ktb-commerce-surface .woocommerce.container {
  display: grid;
  grid-template-columns: minmax(248px, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

body.woocommerce-account.ktb-commerce-surface .woocommerce.container > .woocommerce-notices-wrapper,
body.woocommerce-account.ktb-commerce-surface .woocommerce.container > .woocommerce-message,
body.woocommerce-account.ktb-commerce-surface .woocommerce.container > .woocommerce-info,
body.woocommerce-account.ktb-commerce-surface .woocommerce.container > .woocommerce-error {
  grid-column: 1 / -1;
}

body.woocommerce-account.ktb-commerce-surface .woocommerce.container > .woocommerce-MyAccount-navigation {
  display: none !important;
}

body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content {
  grid-column: 2;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content > * {
  color: var(--ktb-c-text);
}

body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content table.shop_table,
body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content form,
body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content .woocommerce-Address,
body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content .woocommerce-orders-table {
  background: rgba(12, 20, 36, 0.92);
  border: 1px solid var(--ktb-c-border);
  border-radius: 18px;
  box-shadow: var(--ktb-c-shadow);
}

body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content table.shop_table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content table.shop_table th,
body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content table.shop_table td {
  border-color: rgba(118, 142, 185, 0.2);
  color: var(--ktb-c-text);
}

body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content table.shop_table th {
  background: rgba(18, 30, 54, 0.96);
  font-weight: 700;
}

/* Private user menu block */
.ktb-private-user-menu-card {
  grid-column: 1;
  position: sticky;
  top: 106px;
  border: 1px solid var(--ktb-c-border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(170deg, rgba(10, 16, 29, 0.98), rgba(7, 12, 22, 0.9));
  box-shadow: var(--ktb-c-shadow);
}

.ktb-private-user-menu-title {
  margin: 0;
  color: var(--ktb-c-text);
  font-size: 1.02rem;
  font-weight: 700;
}

.ktb-private-user-menu-subtitle {
  margin: 6px 0 14px;
  color: var(--ktb-c-muted);
  font-size: 0.83rem;
}

.ktb-private-user-menu-card nav ul,
.ktb-private-user-menu-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.ktb-private-user-menu-card li {
  margin: 0;
}

.ktb-private-user-menu-card a {
  display: block;
  border: 1px solid rgba(94, 121, 168, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ktb-c-text);
  background: rgba(14, 24, 43, 0.78);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ktb-private-user-menu-card a:hover,
.ktb-private-user-menu-card .current-menu-item > a,
.ktb-private-user-menu-card .current_page_item > a {
  transform: translateY(-1px);
  border-color: rgba(41, 211, 195, 0.58);
  background: rgba(17, 34, 62, 0.92);
}

/* Cart and Checkout */
body.ktb-woo-cart-page.ktb-commerce-surface .woocommerce-cart-form,
body.ktb-woo-cart-page.ktb-commerce-surface .cart-collaterals .cart_totals,
body.ktb-woo-checkout-page.ktb-commerce-surface form.checkout,
body.ktb-woo-checkout-page.ktb-commerce-surface #order_review,
body.ktb-woo-checkout-page.ktb-commerce-surface #order_review_heading {
  border: 1px solid var(--ktb-c-border);
  border-radius: 18px;
  background: rgba(10, 17, 31, 0.94);
  box-shadow: var(--ktb-c-shadow);
  color: var(--ktb-c-text);
}

body.ktb-woo-cart-page.ktb-commerce-surface .woocommerce-cart-form {
  padding: 18px;
}

body.ktb-woo-cart-page.ktb-commerce-surface .cart-collaterals .cart_totals {
  padding: 20px;
}

body.ktb-woo-checkout-page.ktb-commerce-surface form.checkout {
  padding: 20px;
}

body.ktb-woo-checkout-page.ktb-commerce-surface #order_review_heading {
  margin: 18px 0 0;
  padding: 14px 16px;
}

body.ktb-woo-checkout-page.ktb-commerce-surface #order_review {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: 14px 16px;
}

body.ktb-commerce-surface .woocommerce table.shop_table th,
body.ktb-commerce-surface .woocommerce table.shop_table td,
body.ktb-commerce-surface .woocommerce-cart .cart_totals table th,
body.ktb-commerce-surface .woocommerce-cart .cart_totals table td {
  color: var(--ktb-c-text);
  border-color: rgba(124, 146, 182, 0.2);
}

body.ktb-commerce-surface .woocommerce form .form-row input.input-text,
body.ktb-commerce-surface .woocommerce form .form-row textarea,
body.ktb-commerce-surface .woocommerce form .form-row select,
body.ktb-commerce-surface #wcfm_membership_container input[type="text"],
body.ktb-commerce-surface #wcfm_membership_container input[type="password"],
body.ktb-commerce-surface #wcfm_membership_container input[type="number"],
body.ktb-commerce-surface #wcfm_membership_container textarea,
body.ktb-commerce-surface #wcfm_membership_container select {
  border-radius: 12px;
  border: 1px solid rgba(96, 119, 163, 0.34);
  background: rgba(10, 17, 31, 0.88);
  color: var(--ktb-c-text);
}

/* WCFM membership table */
body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 12px clamp(12px, 2.4vw, 24px) 36px;
}

body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm-main-contentainer .wcfm_membership_box_wrraper {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
}

body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_box {
  border: 1px solid rgba(104, 124, 165, 0.34);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(11, 19, 34, 0.92);
  box-shadow: var(--ktb-c-shadow);
}

body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_box_head {
  background: linear-gradient(135deg, rgba(76, 127, 255, 0.21), rgba(41, 211, 195, 0.15));
}

body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_title_text,
body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_price,
body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_description_content,
body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_element_content {
  color: var(--ktb-c-text);
}

/* WCFM registration page */
body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_container {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px clamp(12px, 2.4vw, 24px) 36px;
}

body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form .wcfm-container {
  border: 1px solid var(--ktb-c-border);
  border-radius: 18px;
  background: rgba(11, 19, 34, 0.94);
  box-shadow: var(--ktb-c-shadow);
  padding: 18px;
}

body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form .wcfm_title,
body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form p.wcfm_title {
  width: 100% !important;
  float: none !important;
  color: var(--ktb-c-text);
  margin: 0 0 7px !important;
}

body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form .wcfm_ele,
body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form .wcfm_email_verified,
body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form .wcfm_sms_verified {
  width: 100% !important;
  float: none !important;
  margin: 0 0 14px !important;
}

body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form .wcfm_message,
body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_form .wcfm-message {
  border-radius: 12px;
}

body.ktb-wcfm-register-page.ktb-commerce-surface #wcfm_membership_registration_submit {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* WCFM store manager light surface */
body.ktb-store-manager-light #wcfm-main-contentainer {
  max-width: 1240px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--ktb-c-shadow);
}

body.ktb-store-manager-light #wcfm_menu {
  background: linear-gradient(180deg, #0a1322, #08111e);
}

body.ktb-store-manager-light #wcfm-content {
  background: radial-gradient(circle at 100% 0, rgba(76, 127, 255, 0.14), transparent 35%), #070f1b;
}

body.ktb-store-manager-light .wcfm-container,
body.ktb-store-manager-light .wcfm-collapse-content,
body.ktb-store-manager-light .wcfm-content {
  border-radius: 14px;
  border-color: rgba(101, 123, 170, 0.28);
  background: rgba(8, 14, 25, 0.92);
}

body.ktb-store-manager-light .wcfm_dashboard_stats_block,
body.ktb-store-manager-light .wcfm_dashboard_item {
  border-radius: 12px;
  border-color: rgba(109, 133, 175, 0.28);
  background: rgba(11, 20, 36, 0.92);
}

@media (max-width: 1080px) {
  body.woocommerce-account.ktb-commerce-surface .woocommerce.container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ktb-private-user-menu-card {
    position: static;
    grid-column: 1;
  }

  body.woocommerce-account.ktb-commerce-surface .woocommerce-MyAccount-content {
    grid-column: 1;
  }
}

@media (max-width: 782px) {
  body.ktb-commerce-surface .woocommerce.container {
    padding: 8px 12px 22px;
  }

  body.ktb-woo-checkout-page.ktb-commerce-surface form.checkout,
  body.ktb-woo-cart-page.ktb-commerce-surface .woocommerce-cart-form,
  body.ktb-woo-cart-page.ktb-commerce-surface .cart-collaterals .cart_totals {
    padding: 12px;
    border-radius: 14px;
  }

  body.ktb-wcfm-membership-page.ktb-commerce-surface #wcfm_membership_container .wcfm_membership_boxes {
    grid-template-columns: 1fr;
  }
}
