/*
Theme Name: Alqussadi-theme-2
Theme URI: #
Author: Alqussadi
Author URI: #
Description: alqussadi for electronics tools kitchen appliances and more.
Version: 1.1.0
Text Domain: alqussadi
Requires at least: 6.0
Requires PHP: 7.4
Requires Plugins: woocommerce
*/

/*
 * The main design CSS is loaded from styles.css (theme root).
 * Below: WP/WooCommerce integration overrides + responsive breakpoints.
 */

/* ── Cart badge: hide when fragment leaves it empty ── */
.alq-cart-count:empty { display: none; }

/* Mobile (Small) */
@media (max-width: 576px) {
  .utilbar {
    display: none; /* Hide top utility bar on small screens to save space */
  }

  .header .row {
    grid-template-columns: 1fr auto;
    gap: 16px;
    height: auto;
    padding: 16px 28px;
  }

  .brand-name {
    font-size: 18px;
  }
  .brand-tag {
    display: none;
  }

  /* Search bar */
  .alq-search-bar {
    grid-column: 1 / -1;
    order: 3;
    margin-top: 8px;
  }

  .header-actions {
    gap: 0;
  }
  .header-actions .label {
    display: none; /* Hide labels, show icons only with badges */
  }
  .header-actions .icon-btn {
    padding: 8px;
  }

  /* Nav */
  .nav .nav-all, .nav .nav-extras {
    display: none; /* Hide extra nav stuff on mobile */
  }

  /* Hero */
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero2-row {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    text-align: center;
  }
  .hero2-copy {
    padding-left: 0;
  }
  .hero2-product {
    min-height: 300px;
  }
  .hero2 h1 {
    font-size: 36px;
  }
  .hero2-trust {
    justify-content: center;
  }

  .cats, .flash-grid, .products, .why-grid, .brands {
    grid-template-columns: repeat(2, 1fr);
  }

  .promos {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .newsletter {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    text-align: center;
  }
  .newsletter .deco {
    display: none;
  }

  footer .top {
    grid-template-columns: 1fr;
  }
}

/* Tablet (Portrait) */
@media (min-width: 577px) and (max-width: 768px) {
  .header .row {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
  .alq-search-bar {
    grid-column: 1 / -1;
    order: 3;
  }

  .header-actions .label {
    display: none;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero2-row {
    grid-template-columns: 1fr;
    padding: 40px;
  }

  .cats {
    grid-template-columns: repeat(4, 1fr);
  }

  .promos, .flash-grid, .products {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .why-grid, .brands {
    grid-template-columns: repeat(2, 1fr);
  }

  footer .top {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet (Landscape) / Small Desktop */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 280px;
  }

  .hero2-row {
    grid-template-columns: 1fr 1fr;
    padding: 40px;
  }
  
  .hero2 h1 {
    font-size: 42px;
  }

  .cats {
    grid-template-columns: repeat(4, 1fr);
  }

  .promos {
    grid-template-columns: repeat(3, 1fr);
  }

  .flash-grid, .products {
    grid-template-columns: repeat(3, 1fr);
  }

  .why-grid, .brands {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* ───────────────── SEARCH BAR FIX ───────────────── */

.alq-search-bar {
  display: flex;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
}

.alq-search-bar form {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.alq-search-bar input[type="text"] {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  padding: 15px 18px;
  font-size: 14px;
  background: transparent;
  min-width: 0;
}

.alq-search-bar .go {
  width: 56px;
  min-width: 56px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--blue-600);
  color: #fff;

  border: none;
  cursor: pointer;
}

.alq-search-bar .go svg {
  width: 20px;
  height: 20px;
}

/* prevent AI/generated overrides */
.header-row .alq-search-bar .go {
  position: static !important;
  inset: auto !important;
}

/* ───────────────── MOBILE HEADER FIX ───────────────── */
@media (max-width: 767px) {
  .header-row {
    display: grid !important;
    grid-template-columns: 48px 1fr 48px;
    grid-template-areas:
      "hamburger cart brand"
      "search search search";
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .header-row .hamburger {
    grid-area: hamburger;
    display: flex !important;
    order: unset !important;
    margin: 0 !important;
    min-width: 40px;
    width: 40px;
    height: 40px;
    justify-self: start;
  }

  .header-row .brand {
    grid-area: brand;
    justify-self: end;
    margin: 0 !important;
  }

  .header-row .brand-mark img {
    max-width: 92px;
    height: auto;
    display: block;
  }

  .header-row .header-actions {
    grid-area: cart;
    justify-self: center;
    display: flex;
    justify-content: center;
    margin: 0 !important;
  }

  .header-row .cart-btn {
    width: 56px;
    height: 44px;
    padding: 0;
    justify-content: center;
    position: relative;
  }

  .header-row .alq-search-bar {
    grid-area: search;
    width: 100%;
    margin: 0 !important;
  }

  .header-row .alq-search-bar .cat {
    display: none;
  }

  .header-row .alq-search-bar form {
    width: 100%;
  }
}

.products .product .media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.products .product .media img,
.flash-grid .product .media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* =========================================
   REAL PRODUCT LAYOUT FIX
========================================= */

.pd-layout{
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 48px;

  width: 100%;
}

/* الصورة */
.pd-layout .woocommerce-product-gallery{
  width: 42%;
  flex-shrink: 0;
}

/* المعلومات */
.pd-layout .summary{
  flex: 1;
  max-width: 560px;
}

/* الصورة الرئيسية */
.pd-layout .woocommerce-product-gallery__wrapper{
  border-radius: 28px;
  overflow: hidden;
}

/* الصورة نفسها */
.pd-layout .woocommerce-product-gallery img{
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 28px;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width:768px){

  .pd-layout{
    flex-direction: column;
    gap: 24px;
  }

  .pd-layout .woocommerce-product-gallery{
    width: 100%;
    order: 1;
  }

  .pd-layout .summary{
    width: 100%;
    max-width: 100%;
    order: 2;
  }

}

/* =========================================
   FORCE PRODUCT IMAGE SIZE FIX
========================================= */

.single-product .product{
  display: block !important;
}

.pd-layout{
  display: flex !important;
  flex-direction: row;
  align-items: flex-start;
  gap: 48px;
}

/* عمود الصورة */
.pd-gallery-wrap{
  width: 48%;
  max-width: 48%;
  flex-shrink: 0;
}

/* الصورة الرئيسية */
.pd-gallery-wrap .woocommerce-product-gallery{
  width: 100%;
}

/* wrapper الصورة */
.pd-gallery-wrap .woocommerce-product-gallery__wrapper{
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg-soft);
}

/* الصورة نفسها */
.pd-gallery-wrap img{
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 28px;
}

/* عمود المعلومات */
.pd-layout .summary{
  flex: 1;
  max-width: 560px;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width:768px){

  .pd-layout{
    flex-direction: column !important;
  }

  .pd-gallery-wrap{
    width: 100%;
    max-width: 100%;
  }

  .pd-layout .summary{
    max-width: 100%;
  }

}

.pd-layout .woocommerce-product-gallery__wrapper{
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    background: #fff;

    box-shadow:
      0 24px 60px -18px rgba(14,31,91,0.22),
      0 10px 24px rgba(14,31,91,0.08);
}

.single-product .product{
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    transform: none !important;
    transition: none !important;
}

.wc-block-cart .wc-block-cart__submit-container{		
  padding: 0;		
  border: 1px solid #0f1f5b;
}
.wc-block-cart__submit-button a,
.wc-block-cart__submit-button a:hover,
.wc-block-components-button,
.wc-block-components-button:hover {
  text-decoration: none !important;
}

/* Remove underline from checkout button */
.wc-block-components-button__text {
  text-decoration: none !important;
  color: #0f1f5b !important;
}

.wc-block-components-button:hover .wc-block-components-button__text {
  text-decoration: none !important;
  color: #0f1f5b !important;
}
a.nav-link.hot {
    color: var(--coral-600) !important;
}
/* FIX PAGINATION CLICK ISSUE */

.pagination,
.woocommerce-pagination {
  position: relative;
  z-index: 50;
}

.pagination * ,
.woocommerce-pagination * {
  pointer-events: auto !important;
}
.page-btn {
  display: contents !important;
}

.page-btn a,
.page-btn span {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
  display: grid !important;
  place-items: center;
}
.page-btn.active span,
.page-btn.active a,
.page-btn .current {
  background: var(--blue-600);
  color: #fff !important;
  border-color: var(--blue-600);
}
/* WooCommerce Product Categories Block */
.wp-block-woocommerce-product-categories {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-block-woocommerce-product-categories li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-block-woocommerce-product-categories li a {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 12px;
  border-radius: var(--r-md);

  color: var(--ink-700);
  font-size: 14px;
  font-weight: 500;

  transition: .15s ease;
}

.wp-block-woocommerce-product-categories li a:hover {
  background: var(--bg-soft);
  color: var(--blue-600);
}

.wp-block-woocommerce-product-categories-count {
  font-size: 11px;
  color: var(--ink-400);
}