/* Dazzling Store — Shopify-style clean overrides */

/* ---------- Typography: clean, natural, Shopify-like ---------- */
html body,
html body .ast-container,
html body p,
html body span,
html body div,
html body li,
html body a,
html body input,
html body select,
html body textarea,
html body button {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html[lang^="ar"] body,
html[lang^="ar"] body * {
    font-family: 'Cairo', 'Inter', system-ui, sans-serif !important;
}

html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6,
html body .entry-title,
html body .product_title,
html body .woocommerce-loop-product__title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
}

html[lang^="ar"] body h1,
html[lang^="ar"] body h2,
html[lang^="ar"] body h3,
html[lang^="ar"] body h4,
html[lang^="ar"] body h5,
html[lang^="ar"] body h6 {
    font-family: 'Cairo', 'Inter', sans-serif !important;
}

/* ---------- Menu: kill the wide letter-spacing ---------- */
.main-header-menu .menu-item a,
.main-header-menu > li > a,
.main-navigation li a,
#ast-desktop-header .ast-builder-menu-1 .menu-item a {
    letter-spacing: 0.02em !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
}

/* ---------- Buttons: clean Shopify-like ---------- */
html body .button,
html body button,
html body input[type="submit"],
html body .wp-block-button__link,
html body .single_add_to_cart_button,
html body .checkout-button,
html body .ast-button,
html body .wc-block-components-button {
    border-radius: 4px !important;
    letter-spacing: 0.04em !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    padding: 14px 28px !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
}

html body .single_add_to_cart_button,
html body .checkout-button.button.alt,
html body .wc-proceed-to-checkout .button.alt {
    background: #111 !important;
    color: #fff !important;
}

html body .single_add_to_cart_button:hover,
html body .checkout-button.button.alt:hover {
    background: #000 !important;
    transform: translateY(-1px);
}

html body .single_add_to_cart_button.disabled,
html body .single_add_to_cart_button.wc-variation-selection-needed {
    background: #111 !important;
    color: #fff !important;
    opacity: 1 !important;
}

/* Outline secondary buttons */
html body .added_to_cart,
html body .button.alt.outline {
    background: transparent !important;
    color: #111 !important;
    border: 1px solid #111 !important;
}

/* ---------- Product cards: cleaner ---------- */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 32px !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin-top: 12px !important;
    margin-bottom: 4px !important;
    color: #111 !important;
}

.woocommerce ul.products li.product .price,
.woocommerce-page ul.products li.product .price {
    color: #444 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img {
    border-radius: 4px !important;
    transition: opacity 0.3s ease;
    background: #f5f5f5;
    aspect-ratio: 4/5;
    object-fit: cover;
    width: 100%;
}

.woocommerce ul.products li.product img:hover {
    opacity: 0.85;
}

/* Sale badge */
.woocommerce span.onsale,
.woocommerce-page span.onsale {
    background: #111 !important;
    color: #fff !important;
    border-radius: 2px !important;
    font-weight: 500 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 4px 10px !important;
    min-height: auto !important;
    line-height: 1.5 !important;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
}

/* ---------- Single product ---------- */
.single-product .product_title {
    font-size: 28px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    margin-bottom: 8px !important;
}

.single-product .price {
    font-size: 22px !important;
    font-weight: 500 !important;
    color: #111 !important;
}

.single-product table.variations {
    margin-bottom: 20px !important;
    border: none !important;
}

.single-product table.variations th,
.single-product table.variations td {
    border: none !important;
    padding: 8px 0 !important;
    background: transparent !important;
}

.single-product table.variations label {
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    letter-spacing: 0.05em !important;
    color: #111 !important;
}

.single-product .variations select {
    border: 1px solid #d9d9d9 !important;
    border-radius: 4px !important;
    padding: 10px 14px !important;
    background: #fff !important;
    font-size: 14px !important;
}

/* ---------- Cart / Checkout ---------- */
.woocommerce-cart table.cart,
.woocommerce-checkout #order_review {
    border: 1px solid #ececec !important;
    border-radius: 6px !important;
}

.woocommerce-cart table.cart th,
.woocommerce-cart table.cart td {
    border-color: #ececec !important;
}

.cart_totals h2,
.woocommerce-checkout h3 {
    text-transform: none !important;
    letter-spacing: -0.01em !important;
    font-weight: 600 !important;
}

/* ---------- Forms ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    border: 1px solid #d9d9d9 !important;
    border-radius: 4px !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    transition: border-color 0.2s !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    border-color: #111 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05) !important;
}

/* ---------- Header ---------- */
.ast-primary-header-bar,
.site-header {
    border-bottom: 1px solid #f0f0f0 !important;
    background: #fff !important;
}

/* Cart count badge */
.ast-cart-menu-wrap .count,
.astra-cart-drawer-button .count {
    background: #111 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

/* ---------- Misc cleanup ---------- */
/* Remove the ugly grey "ADD TO CART" outline border on hover state */
html body .single_add_to_cart_button:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1) !important;
}

/* Footer */
.site-footer {
    border-top: 1px solid #f0f0f0;
}

/* Responsive: tighter on mobile */
@media (max-width: 768px) {
    .single-product .product_title { font-size: 22px !important; }
    .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 14px !important; }
}

/* ---------- CartFlows Thank-You / Order Status pages ---------- */
body.woocommerce-order-received .site-content,
body.woocommerce-order-received .ast-container,
body.cartflows_step-template main,
body.woocommerce-order-received main {
    background: #fafafa;
    min-height: 80vh;
}

/* Center the order content as a card */
body.woocommerce-order-received .wcf-instant-thankyou,
body.cartflows_step-template .wcf-instant-thankyou,
body.woocommerce-order-received .woocommerce-order,
body.cartflows_step-template .woocommerce-order,
body.woocommerce-order-received .woocommerce,
body.cartflows_step-template .woocommerce {
    max-width: 720px !important;
    margin: 60px auto !important;
    padding: 48px 40px !important;
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04) !important;
    border: 1px solid #ececec !important;
    box-sizing: border-box !important;
}

/* If both wcf and order exist, only the outer wraps */
body.woocommerce-order-received .wcf-instant-thankyou .woocommerce-order,
body.cartflows_step-template .wcf-instant-thankyou .woocommerce-order {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Failed order notice — turn into a clean alert card */
.woocommerce-notice--error.woocommerce-thankyou-order-failed,
.woocommerce-notice.woocommerce-thankyou-order-failed {
    background: #fff5f5 !important;
    border: 1px solid #fecaca !important;
    border-left: 4px solid #dc2626 !important;
    color: #7f1d1d !important;
    padding: 20px 24px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin: 0 0 24px 0 !important;
    position: relative;
}

.woocommerce-notice--error.woocommerce-thankyou-order-failed::before {
    content: "⚠ Order Failed";
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

/* Success order notice */
.woocommerce-notice.woocommerce-thankyou-order-received,
.woocommerce-order-received .woocommerce > p:first-child {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 4px solid #16a34a !important;
    color: #14532d !important;
    padding: 20px 24px !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin: 0 0 24px 0 !important;
}

/* Order details list */
.woocommerce-order .woocommerce-order-overview,
.woocommerce-order ul.order_details {
    list-style: none !important;
    padding: 24px !important;
    margin: 24px 0 !important;
    background: #fafafa !important;
    border: 1px solid #ececec !important;
    border-radius: 6px !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 16px !important;
}

.woocommerce-order ul.order_details li {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #888 !important;
    font-weight: 500 !important;
}

.woocommerce-order ul.order_details li strong {
    display: block !important;
    color: #111 !important;
    font-size: 16px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin-top: 4px !important;
    font-weight: 600 !important;
}

/* Failed order action buttons (PAY, MY ACCOUNT) */
.woocommerce-thankyou-order-failed-actions,
p.woocommerce-thankyou-order-failed-actions {
    display: flex !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin: 24px 0 !important;
}

.woocommerce-thankyou-order-failed-actions a,
.woocommerce-thankyou-order-failed-actions .button {
    display: inline-block !important;
    padding: 14px 32px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    border: 1px solid transparent !important;
    text-align: center !important;
    flex: 1 !important;
    min-width: 180px !important;
}

/* PAY button — primary black */
.woocommerce-thankyou-order-failed-actions a.pay,
.woocommerce-thankyou-order-failed-actions a:first-child {
    background: #111 !important;
    color: #fff !important;
}

.woocommerce-thankyou-order-failed-actions a.pay:hover,
.woocommerce-thankyou-order-failed-actions a:first-child:hover {
    background: #000 !important;
    transform: translateY(-1px);
}

/* MY ACCOUNT button — outlined secondary */
.woocommerce-thankyou-order-failed-actions a:last-child:not(:first-child),
.woocommerce-thankyou-order-failed-actions a.my-account {
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #d9d9d9 !important;
}

.woocommerce-thankyou-order-failed-actions a:last-child:not(:first-child):hover,
.woocommerce-thankyou-order-failed-actions a.my-account:hover {
    background: #f5f5f5 !important;
    border-color: #111 !important;
}

/* Order details table */
.woocommerce-order-details {
    margin-top: 32px !important;
}

.woocommerce-order-details h2,
.woocommerce-customer-details h2,
.woocommerce-column__title {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #ececec !important;
    color: #111 !important;
}

.woocommerce-order-details table.shop_table,
.woocommerce-table--order-details {
    border: 1px solid #ececec !important;
    border-radius: 6px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
}

.woocommerce-order-details table.shop_table th,
.woocommerce-order-details table.shop_table td {
    padding: 14px 16px !important;
    border-color: #ececec !important;
    background: transparent !important;
}

.woocommerce-order-details table.shop_table tfoot th,
.woocommerce-order-details table.shop_table tfoot td {
    background: #fafafa !important;
}

/* Customer details columns */
.woocommerce-customer-details {
    margin-top: 32px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
}

.woocommerce-customer-details address {
    border: 1px solid #ececec !important;
    border-radius: 6px !important;
    padding: 20px !important;
    font-style: normal !important;
    line-height: 1.7 !important;
    background: #fafafa !important;
}

@media (max-width: 600px) {
    body.woocommerce-order-received .woocommerce,
    body.cartflows_step-template .woocommerce {
        margin: 20px 12px !important;
        padding: 24px 20px !important;
    }
    .woocommerce-customer-details {
        grid-template-columns: 1fr !important;
    }
    .woocommerce-thankyou-order-failed-actions {
        flex-direction: column !important;
    }
}
