/**
Theme Name: CloudAD-DSM
Author: CloudAD
Description: Astra child theme for CloudAD Data Studio Marketplace.
Version: 1.0.0
Template: astra
Text Domain: cloudad-dsm
*/

/* ==============================
   WooCommerce My Account - Logged Out
============================== */

.cloudad-myaccount-google-login {
  max-width: 520px;
  margin: 72px auto;
  padding: 44px 40px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.06);
}

.cloudad-myaccount-google-login h1 {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 800;
  color: #0b1f3a;
}

.cloudad-myaccount-google-login p {
  margin: 0 0 28px;
  color: #666666;
  line-height: 1.7;
  font-size: 15px;
}

.cloudad-google-login-button {
  display: flex;
  justify-content: center;
}

/* ==============================
   WooCommerce My Account - Dashboard
============================== */

.cloudad-account-dashboard,
.cloudad-invoice-panel {
  padding: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
}

.cloudad-account-dashboard h2,
.cloudad-invoice-panel h2 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  color: #0b1f3a;
}

.cloudad-account-dashboard p,
.cloudad-invoice-panel p {
  margin: 0 0 24px;
  color: #555555;
  line-height: 1.7;
  font-size: 15px;
}

.cloudad-account-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cloudad-account-actions .button,
.cloudad-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 8px;
  background: #006bd6;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  border: none;
}

.cloudad-account-actions .button:hover,
.cloudad-primary-button:hover {
  background: #0057ad;
  color: #ffffff;
}

/* ==============================
   Invoice Form
============================== */

.cloudad-invoice-form {
  margin-top: 24px;
}

.cloudad-form-row {
  margin-bottom: 18px !important;
}

.cloudad-form-row label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #0b1f3a;
}

.cloudad-form-row label span {
  color: #d63638;
}

.cloudad-form-row input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
}

.cloudad-form-row input:focus {
  border-color: #006bd6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 107, 214, 0.12);
}

.cloudad-form-row input:disabled {
  background: #f5f7fa;
  color: #666666;
}

/* ==============================
   WooCommerce My Account - Layout Polish
============================== */

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
  border-bottom: 1px solid #e5e7eb;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 14px 18px;
  text-decoration: none;
  font-weight: 600;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  background: #f5f8fb;
  color: #0b1f3a;
}

/* ==============================
   Responsive
============================== */

@media (max-width: 768px) {
  .cloudad-myaccount-google-login {
    margin: 40px 16px;
    padding: 32px 24px;
  }

  .cloudad-myaccount-google-login h1 {
    font-size: 26px;
  }

  .cloudad-account-dashboard,
  .cloudad-invoice-panel {
    padding: 24px;
  }

  .cloudad-account-dashboard h2,
  .cloudad-invoice-panel h2 {
    font-size: 24px;
  }

  .cloudad-account-actions {
    flex-direction: column;
  }

  .cloudad-account-actions .button,
  .cloudad-primary-button {
    width: 100%;
  }
}

.cloudad-checkout-google-login {
  max-width: 520px;
  margin: 72px auto;
  padding: 44px 40px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.06);
}

.cloudad-checkout-google-login h1 {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 800;
  color: #0b1f3a;
}

.cloudad-checkout-google-login p {
  margin: 0 0 28px;
  color: #666666;
  line-height: 1.7;
  font-size: 15px;
}

.cloudad-fixed-cart-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 40px;
  border: 1px solid #d8dee4;
  background: #f8fafc;
  color: #0b1f3a;
  font-weight: 600;
}


/* 先隱藏 WooCommerce / Astra / Elementor 原生商品卡片加入購物車按鈕 */
.woocommerce ul.products li.product a.button.add_to_cart_button,
.woocommerce ul.products li.product a.button.product_type_simple,
.elementor-widget-woocommerce-archive-products ul.products li.product a.button.add_to_cart_button,
.elementor-widget-woocommerce-archive-products ul.products li.product a.button.product_type_simple,
.elementor-widget-woocommerce-products ul.products li.product a.button.add_to_cart_button,
.elementor-widget-woocommerce-products ul.products li.product a.button.product_type_simple {
  display: none !important;
  visibility: hidden !important;
}

/* 重新顯示 CloudAD 自訂按鈕區裡的按鈕 */
.woocommerce ul.products li.product .cloudad-loop-actions a.button,
.elementor-widget-woocommerce-archive-products ul.products li.product .cloudad-loop-actions a.button,
.elementor-widget-woocommerce-products ul.products li.product .cloudad-loop-actions a.button {
  display: inline-flex !important;
  visibility: visible !important;
}

/* CloudAD 商品卡片自訂按鈕區 */
.cloudad-loop-actions {
  display: flex !important;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  margin-top: 16px;
}

/* 自訂按鈕共用樣式 */
.cloudad-loop-actions .button {
  flex: 1;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-radius: 6px;
  padding: 12px 14px;
  line-height: 1.2;
  font-weight: 600;
  box-sizing: border-box;
  min-height: 46px;
}

/* 自訂區內的加入購物車 */
.cloudad-loop-actions .add_to_cart_button,
.cloudad-loop-actions .product_type_simple {
  background: #0066cc !important;
  color: #fff !important;
  border: 1px solid #0066cc !important;
}

/* 線上預覽 */
.cloudad-loop-actions .cloudad-preview-button {
  background: #fff !important;
  color: #0066cc !important;
  border: 1px solid #0066cc !important;
}

/* Hover */
.cloudad-loop-actions .add_to_cart_button:hover,
.cloudad-loop-actions .product_type_simple:hover {
  background: #0052a3 !important;
  border-color: #0052a3 !important;
  color: #fff !important;
}

.cloudad-loop-actions .cloudad-preview-button:hover {
  background: #f2f7ff !important;
  color: #0052a3 !important;
  border-color: #0052a3 !important;
}

/* 手機版：兩顆按鈕上下排列 */
@media (max-width: 767px) {
  .cloudad-loop-actions {
    flex-direction: column;
  }

  .cloudad-loop-actions .button {
    width: 100%;
  }
}
