/* ============================================================
   Alsaafin SEO Theme - WooCommerce styles
   Loaded only on shop/product/cart/checkout/account pages.
   Reuses the theme's design tokens defined in style.css (:root).
   ============================================================ */

/* ---------- General WooCommerce notices ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
  list-style: none;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.woocommerce-message { border-inline-start-color: var(--success); }
.woocommerce-error   { border-inline-start-color: #dc2626; }
.woocommerce-message a.button,
.woocommerce-error a.button {
  background: var(--secondary);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 700;
  text-decoration: none;
  font-size: .9rem;
}

/* ============================================================
   SHOP / ARCHIVE
   ============================================================ */
.shop-hero .woocommerce-products-header__title { display: none; } /* h1 already rendered above via woocommerce_page_title() */
.shop-hero .term-description,
.shop-hero .page-description {
  color: rgba(255,255,255,.85);
  max-width: 700px;
  margin: 12px auto 0;
}

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.shop-toolbar .woocommerce-result-count { color: var(--text-gray); margin: 0; }
.shop-toolbar .woocommerce-ordering select {
  padding: 10px 16px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  color: var(--text-dark);
  font-family: inherit;
}

ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  list-style: none;
  margin: 0 0 48px;
  padding: 0;
}
ul.products li.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
ul.products li.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
}
.product-card-link { display: block; color: inherit; text-decoration: none; }
.product-card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-light); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
ul.products li.product-card:hover .product-card-media img { transform: scale(1.06); }
.product-card-media .onsale {
  position: absolute; top: 14px; inset-inline-start: 14px;
  background: var(--secondary); color: var(--primary);
  font-weight: 800; font-size: .8rem; padding: 5px 14px;
  border-radius: 50px; box-shadow: var(--shadow-sm); z-index: 2;
}
.product-card-body { padding: 20px 20px 8px; flex-grow: 1; }
.product-card-body h2, .product-card-body h3 {
  font-size: 1.05rem; font-weight: 800; color: var(--primary);
  margin-bottom: 8px; line-height: 1.5;
}
.product-card-body .star-rating { margin-bottom: 8px; font-size: .85rem; color: var(--secondary); }
.product-card-body .price {
  font-size: 1.15rem; font-weight: 800; color: var(--accent);
}
.product-card-body .price del { color: var(--text-light); font-weight: 500; opacity: .7; margin-inline-end: 8px; }
.product-card-body .price ins { text-decoration: none; }
.product-card-footer { padding: 12px 20px 22px; }
.product-card-footer .button,
.product-card-footer a.add_to_cart_button,
.product-card-footer a.button {
  display: block; width: 100%; text-align: center;
  background: var(--primary); color: #fff; border: none;
  padding: 12px 20px; border-radius: 50px; font-weight: 700;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.product-card-footer .button:hover { background: var(--secondary); color: var(--primary); }
.product-card-footer .added_to_cart { display: block; text-align: center; margin-top: 8px; font-size: .85rem; color: var(--success); }

.woocommerce-pagination { margin-top: 24px; }
.woocommerce-pagination ul.page-numbers {
  display: flex; list-style: none; gap: 8px; justify-content: center; padding: 0;
}
.woocommerce-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg-white); border: 1px solid var(--border);
  color: var(--text-dark); text-decoration: none; font-weight: 700;
}
.woocommerce-pagination .page-numbers.current,
.woocommerce-pagination .page-numbers:hover { background: var(--secondary); color: var(--primary); border-color: var(--secondary); }

/* ============================================================
   SINGLE PRODUCT
   ============================================================ */
.single-product-hero { padding: 28px 0 0; }
.single-product .product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 40px;
  margin-bottom: 56px;
}
@media (max-width: 860px) { .single-product .product { grid-template-columns: 1fr; padding: 24px; gap: 28px; } }

.single-product .woocommerce-product-gallery__wrapper { border-radius: var(--radius); overflow: hidden; }
.single-product .woocommerce-product-gallery img { border-radius: var(--radius); }
.single-product .flex-control-thumbs { display: flex; gap: 10px; margin-top: 12px; list-style: none; padding: 0; }
.single-product .flex-control-thumbs li { width: 72px; }
.single-product .flex-control-thumbs img { border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.single-product .flex-control-thumbs img.flex-active { border-color: var(--secondary); }

.single-product .summary { display: flex; flex-direction: column; }
.single-product .summary .product_title { font-size: 2rem; font-weight: 900; color: var(--primary); margin-bottom: 12px; line-height: 1.3; }
.single-product .summary .price { font-size: 1.8rem; font-weight: 900; color: var(--accent); margin-bottom: 20px; }
.single-product .summary .price del { color: var(--text-light); font-size: 1.1rem; font-weight: 500; margin-inline-end: 12px; }
.single-product .summary .woocommerce-product-details__short-description { color: var(--text-gray); line-height: 1.9; margin-bottom: 24px; }
.single-product .summary .stock { display: inline-block; padding: 6px 16px; border-radius: 50px; font-weight: 700; font-size: .9rem; margin-bottom: 20px; background: var(--accent-light); color: var(--accent); width: fit-content; }
.single-product .summary .stock.out-of-stock { background: #fee2e2; color: #dc2626; }

.single-product form.cart { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.single-product .quantity { display: flex; }
.single-product .quantity .qty {
  width: 70px; text-align: center; padding: 12px 8px; border-radius: 0;
  border: 1.5px solid var(--border); border-inline-start: none; border-inline-end: none; font-family: inherit; font-weight: 700;
}
.alsf-qty-btn {
  width: 42px; border: 1.5px solid var(--border); background: var(--bg-light); color: var(--primary);
  font-size: 1.1rem; font-weight: 800; cursor: pointer; transition: var(--transition);
}
.alsf-qty-minus { border-radius: 50px 0 0 50px; border-inline-end: none; }
.alsf-qty-plus { border-radius: 0 50px 50px 0; border-inline-start: none; }
.alsf-qty-btn:hover { background: var(--secondary); color: var(--primary); border-color: var(--secondary); }
.single-product button.single_add_to_cart_button {
  background: var(--secondary); color: var(--primary); border: none;
  padding: 14px 36px; border-radius: 50px; font-weight: 800; font-size: 1rem;
  cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-sm);
}
.single-product button.single_add_to_cart_button:hover { background: var(--secondary-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.single-product .product_meta { font-size: .875rem; color: var(--text-light); border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto; }
.single-product .product_meta > span { display: block; margin-bottom: 6px; }
.single-product .product_meta a { color: var(--accent); }

.alsf-product-trust-badges {
  display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 8px; margin-bottom: 20px;
  padding-top: 18px; border-top: 1px dashed var(--border); font-size: .85rem; color: var(--text-gray);
}

.alsf-sticky-add-to-cart {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 999;
  background: var(--bg-white); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(0,0,0,.08);
  padding: 12px 20px; transform: translateY(100%); transition: transform .25s ease;
  display: none;
}
@media (max-width: 820px) { .alsf-sticky-add-to-cart { display: block; } }
.alsf-sticky-add-to-cart.is-visible { transform: translateY(0); }
.alsf-sticky-add-to-cart-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 700px; margin: 0 auto; }
.alsf-sticky-product-info { display: flex; flex-direction: column; overflow: hidden; }
.alsf-sticky-name { font-weight: 700; color: var(--primary); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alsf-sticky-price { color: var(--accent); font-weight: 800; }
.alsf-sticky-btn { flex-shrink: 0; background: var(--secondary); color: var(--primary) !important; padding: 10px 24px; border-radius: 50px; font-weight: 800; text-decoration: none; }
.alsf-sticky-btn-disabled { background: var(--border); color: var(--text-light) !important; }

/* Tabs (description / additional info / reviews) */
.woocommerce-tabs { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 8px; margin-bottom: 56px; }
.woocommerce-tabs ul.tabs { display: flex; gap: 6px; list-style: none; padding: 8px; margin: 0; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.woocommerce-tabs ul.tabs li { margin: 0; }
.woocommerce-tabs ul.tabs li a {
  display: block; padding: 12px 24px; border-radius: 50px; font-weight: 700;
  color: var(--text-gray); text-decoration: none; transition: var(--transition);
}
.woocommerce-tabs ul.tabs li.active a { background: var(--primary); color: #fff; }
.woocommerce-tabs .panel { padding: 32px; color: var(--text-gray); line-height: 1.9; }
.woocommerce-tabs .panel h2 { color: var(--primary); font-weight: 800; margin-bottom: 16px; }
.woocommerce-Reviews #comments { list-style: none; padding: 0; }
.woocommerce-Reviews .comment-form input,
.woocommerce-Reviews .comment-form textarea { width: 100%; padding: 10px 14px; border-radius: 8px; border: 1.5px solid var(--border); font-family: inherit; }

/* Related / upsell products */
.related.products, .upsells.products, .cross-sells {
  margin-top: 8px;
}
.related.products > h2, .upsells.products > h2, .cross-sells > h2 {
  font-size: 1.6rem; font-weight: 900; color: var(--primary); margin-bottom: 28px; text-align: center;
}

/* ============================================================
   CART
   ============================================================ */
.woo-page-hero.plain-hero { background: var(--primary); }
.alsf-cart-layout { display: grid; grid-template-columns: minmax(0,2.1fr) minmax(0,1fr); gap: 32px; align-items: start; }
@media (max-width: 960px) { .alsf-cart-layout { grid-template-columns: 1fr; } }

.alsf-cart-table {
  width: 100%; border-collapse: separate; border-spacing: 0 12px;
}
.alsf-cart-table thead th { text-align: start; font-size: .85rem; color: var(--text-light); font-weight: 700; padding: 0 16px 8px; }
.alsf-cart-table thead th.product-remove, .alsf-cart-table thead th.product-thumbnail { width: 1%; }
.alsf-cart-table tbody tr.cart_item {
  background: var(--bg-white); box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.alsf-cart-table tbody tr.cart_item td { padding: 16px; vertical-align: middle; }
.alsf-cart-table tbody tr.cart_item td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.alsf-cart-table tbody tr.cart_item td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.alsf-cart-table .product-thumbnail img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.alsf-cart-table .product-name a { color: var(--primary); font-weight: 700; text-decoration: none; }
.alsf-cart-table .remove { color: #dc2626; font-size: 1.4rem; text-decoration: none; font-weight: 700; }
.alsf-cart-table .quantity .qty { width: 60px; text-align: center; padding: 8px; border-radius: 8px; border: 1.5px solid var(--border); }
.alsf-cart-table .product-subtotal { font-weight: 800; color: var(--accent); }
.alsf-cart-table tr.actions td { background: transparent; box-shadow: none; border: none; padding-top: 20px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.alsf-cart-table .coupon { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.alsf-cart-table .coupon input { padding: 10px 16px; border-radius: 50px; border: 1.5px solid var(--border); font-family: inherit; }
.alsf-cart-table .coupon button,
.alsf-update-cart-btn {
  background: var(--bg-white); border: 1.5px solid var(--primary); color: var(--primary);
  padding: 10px 22px; border-radius: 50px; font-weight: 700; cursor: pointer;
}
.alsf-cart-table .coupon button:hover, .alsf-update-cart-btn:hover { background: var(--primary); color: #fff; }

.alsf-cart-totals .cart_totals {
  background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 32px; position: sticky; top: 24px;
}
.alsf-cart-totals .cart_totals h2 { font-size: 1.25rem; font-weight: 900; color: var(--primary); margin-bottom: 20px; }
.alsf-cart-totals table.shop_table { width: 100%; }
.alsf-cart-totals table.shop_table th { text-align: start; color: var(--text-gray); font-weight: 600; padding: 12px 0; border-bottom: 1px solid var(--border); }
.alsf-cart-totals table.shop_table td { text-align: end; padding: 12px 0; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text-dark); }
.alsf-cart-totals .order-total td, .alsf-cart-totals .order-total th { border-bottom: none; font-size: 1.2rem; color: var(--primary); }
.alsf-cart-totals .wc-proceed-to-checkout { margin-top: 20px; }
.alsf-cart-totals .checkout-button {
  display: block; text-align: center; width: 100%; background: var(--secondary); color: var(--primary);
  padding: 16px; border-radius: 50px; font-weight: 800; text-decoration: none; transition: var(--transition);
}
.alsf-cart-totals .checkout-button:hover { background: var(--secondary-hover); transform: translateY(-2px); }
.cross-sells { margin-top: 32px; }

/* ============================================================
   CHECKOUT
   ============================================================ */
.alsf-checkout-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 36px; align-items: start; }
@media (max-width: 960px) { .alsf-checkout-layout { grid-template-columns: 1fr; } }

.alsf-checkout-details .col2-set { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 700px) { .alsf-checkout-details .col2-set { grid-template-columns: 1fr; } }
.woocommerce-billing-fields h3, .woocommerce-shipping-fields h3, .woocommerce-additional-fields h3 {
  font-size: 1.15rem; font-weight: 800; color: var(--primary); margin-bottom: 18px;
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: .9rem; color: var(--text-dark); margin-bottom: 6px; }
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="tel"],
.form-row textarea, .form-row select, .select2-container .select2-selection--single {
  width: 100% !important; padding: 12px 16px; border-radius: 10px; border: 1.5px solid var(--border);
  font-family: inherit; background: var(--bg-white); height: auto !important;
}
.woocommerce-additional-fields { margin-top: 8px; }

.alsf-checkout-summary-inner {
  background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 32px; position: sticky; top: 24px;
}
.alsf-checkout-summary-inner h3 { font-size: 1.2rem; font-weight: 900; color: var(--primary); margin-bottom: 20px; }
#order_review table.shop_table { width: 100%; margin-bottom: 20px; }
#order_review table.shop_table th, #order_review table.shop_table td { padding: 10px 0; border-bottom: 1px solid var(--border); }
#order_review .product-name { color: var(--text-gray); }
#order_review .order-total td, #order_review .order-total th { font-size: 1.2rem; color: var(--primary); font-weight: 900; border-bottom: none; }
.woocommerce-checkout-payment { background: var(--bg-light); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.wc_payment_methods { list-style: none; padding: 0; margin: 0 0 16px; }
.wc_payment_method { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; background: var(--bg-white); }
.wc_payment_method label { font-weight: 700; }
.payment_box { padding-top: 12px; color: var(--text-gray); font-size: .9rem; }
#place_order {
  width: 100%; background: var(--secondary); color: var(--primary); border: none;
  padding: 18px; border-radius: 50px; font-weight: 900; font-size: 1.05rem; cursor: pointer;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
#place_order:hover { background: var(--secondary-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.alsf-checkout-trust { text-align: center; font-size: .8rem; color: var(--text-light); margin-top: 16px; }

/* ============================================================
   ORDER RECEIVED / THANK YOU
   ============================================================ */
.alsf-order-received-card {
  max-width: 700px; margin: 0 auto; background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 56px; text-align: center;
}
.alsf-order-icon {
  width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2.25rem; font-weight: 900; margin: 0 auto 24px;
}
.alsf-order-icon-success { background: #dcfce7; color: var(--success); }
.alsf-order-icon-failed { background: #fee2e2; color: #dc2626; }
.alsf-order-title { font-size: 1.75rem; font-weight: 900; color: var(--primary); margin-bottom: 12px; }
.alsf-order-overview { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; text-align: center; }
.alsf-order-overview li { background: var(--bg-light); border-radius: var(--radius); padding: 16px; font-size: .85rem; color: var(--text-gray); }
.alsf-order-overview li strong { display: block; margin-top: 6px; color: var(--primary); font-size: 1rem; }
.alsf-order-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }


/* ============================================================
   Lightweight compatibility for the Cart/Checkout BLOCKS
   (used automatically if the Cart/Checkout pages contain the
   [Cart]/[Checkout] Gutenberg blocks instead of the classic
   [woocommerce_cart]/[woocommerce_checkout] shortcodes - in that
   case the PHP templates above are not used, only these colors apply).
   ============================================================ */
.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout { font-family: 'Tajawal', sans-serif; }
.wc-block-components-button:not(.is-link) {
  background: var(--secondary) !important; color: var(--primary) !important;
  border-radius: 50px !important; font-weight: 800 !important; border: none !important;
}
.wc-block-components-button:not(.is-link):hover { background: var(--secondary-hover) !important; }
.wc-block-cart-item__product-name a, .wc-block-components-product-name { color: var(--primary) !important; font-weight: 700 !important; }
.wc-block-components-totals-item__value, .wc-block-components-totals-footer-item .wc-block-components-totals-item__value { color: var(--primary) !important; font-weight: 800 !important; }
.wc-block-components-panel, .wc-block-cart, .wc-block-checkout { --wc-blue: var(--accent); }
