/*
Theme Name: H-EG Theme
Theme URI: https://healthylifeeg.com
Author: EgyCode Team
Author URI: https://egycode.tech
Description: A premium, minimal luxury wellness theme built for WooCommerce. Features a clean "Medical Precision" design system, RTL-first support, and high performance.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: h-eg-theme
Tags: rtl-language-support, woocommerce, custom-logo, custom-menu, translation-ready, arabic
*/

/* Core styles are handled via Tailwind CSS build process.
   See assets/css/main.css for sources and dist/main.css for output. */

/* ==================================================
   MOBILE & RESPONSIVE OVERRIDES
   ================================================== */

/* ---- Product Cards (content-product.php) ---- */
@media screen and (max-width: 640px) {
    /* Reduce oversized rounded corners on mobile */
    .products .product .bg-white {
        border-radius: 20px !important;
    }
    .products .product .bg-white a.block {
        border-radius: 16px !important;
    }

    /* Reduce heavy padding on content area */
    .products .product .p-8 {
        padding: 12px !important;
    }

    /* Smaller image area padding */
    .products .product .px-6.pt-6 {
        padding: 8px !important;
        padding-top: 8px !important;
    }

    /* Sale badge positioning — closer to corner on small screens */
    .products .product .absolute.top-10.right-10 {
        top: 12px !important;
        right: 12px !important;
    }
    .products .product .absolute.top-10.right-10 span {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }

    /* Floating add-to-cart button */
    .products .product .absolute.bottom-10 {
        bottom: 12px !important;
        left: 8px !important;
        right: 8px !important;
    }

    /* Product title smaller */
    .products .product h2.text-sm {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }

    /* Rating & reviews row spacing */
    .products .product .flex.items-center.gap-3.mb-6 {
        margin-bottom: 8px !important;
    }

    /* Price row spacer */
    .products .product .pt-6.border-t {
        padding-top: 8px !important;
    }

    /* Price font */
    .products .product .text-xl.leading-none {
        font-size: 16px !important;
    }

    /* Action button smaller */
    .products .product a.w-12.h-12 {
        width: 36px !important;
        height: 36px !important;
    }
    .products .product a.w-12.h-12 svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Very small phones (320-375px) — single column products */
@media screen and (max-width: 380px) {
    ul.products.grid {
        grid-template-columns: 1fr !important;
        max-width: 320px;
        margin: 0 auto;
    }
}

/* ---- Front Page Sections ---- */
@media screen and (max-width: 640px) {
    /* Hero image height — reduce on mobile */
    img.h-\[500px\] {
        height: 280px !important;
    }

    /* Hero section padding */
    section.relative.bg-secondary.pt-12.pb-20 {
        padding-top: 16px !important;
        padding-bottom: 32px !important;
    }

    /* Hero title size */
    h1.text-4xl {
        font-size: 1.75rem !important;
    }

    /* Sections padding reduce */
    section.py-20,
    section.py-12 {
        padding-top: 32px !important;
        padding-bottom: 32px !important;
    }

    /* Goals section — smaller icon circles */
    .card-premium .w-20.h-20 {
        width: 48px !important;
        height: 48px !important;
    }
    .card-premium .w-20.h-20 .text-3xl {
        font-size: 1.25rem !important;
    }

    /* Goal card padding */
    a.card-premium.p-6 {
        padding: 12px !important;
    }

    /* Goal card title */
    a.card-premium h3.text-lg {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }

    /* Trust bar items — smaller icons */
    section.py-12 .w-12.h-12 {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
    }

    /* CTA section inner */
    .bg-primary.rounded-3xl.p-8 {
        padding: 24px 16px !important;
        border-radius: 20px !important;
    }
    .bg-primary.rounded-3xl h2.text-3xl {
        font-size: 1.5rem !important;
    }
}

/* ---- Single Product Page ---- */
@media screen and (max-width: 640px) {
    /* Product card main container */
    .bg-white\/80.rounded-\[40px\] {
        border-radius: 16px !important;
    }

    /* Image inner radius */
    .bg-gradient-to-br.rounded-\[32px\] {
        border-radius: 12px !important;
    }

    /* Gallery & info padding */
    .woocommerce.single-product .p-6 {
        padding: 12px !important;
    }

    /* Gallery thumbnails */
    .woocommerce.single-product .grid-cols-4 {
        gap: 6px !important;
    }
    .woocommerce.single-product .grid-cols-4 .rounded-2xl {
        border-radius: 8px !important;
    }

    /* Product title */
    .woocommerce.single-product h1.text-3xl {
        font-size: 1.5rem !important;
    }

    /* Price card padding */
    .woocommerce.single-product .p-6.rounded-3xl {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    /* Countdown timer — stack vertically */
    .woocommerce.single-product .flex.items-center.justify-between.flex-wrap {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    /* Bottom sticky add to cart — prevent content overlap */
    .woocommerce.single-product .site-content {
        padding-bottom: 80px !important;
    }

    /* Floating CTA on product page — above sticky bar */
    #floating-cta {
        bottom: 80px !important;
        right: 16px !important;
    }
}

/* ---- Hide Desktop Add-to-Cart on Mobile (below lg breakpoint) ---- */
@media screen and (max-width: 1023px) {
    /* Force hide desktop add-to-cart form on mobile/tablet */
    .woocommerce.single-product .hidden.lg\:block {
        display: none !important;
    }
    .single-product .hidden.lg\:block {
        display: none !important;
    }
}

/* ---- Header & Topbar ---- */
@media screen and (max-width: 640px) {
    /* Topbar — reduce padding */
    .bg-primary.text-white.text-sm.py-2 {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
        font-size: 11px !important;
    }

    /* Logo text smaller */
    .site-branding .text-2xl {
        font-size: 1rem !important;
    }
    .site-branding img.h-10 {
        height: 32px !important;
    }

    /* Mobile menu drawer full width */
    #mobile-menu .w-80 {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ---- Footer ---- */
@media screen and (max-width: 640px) {
    /* Footer padding */
    footer.pt-16.pb-8 {
        padding-top: 32px !important;
    }

    /* Footer grid gap */
    footer .gap-12 {
        gap: 24px !important;
    }

    /* Payment methods center */
    footer .flex.gap-2.flex-wrap {
        justify-content: center;
    }

    /* Bottom bar center */
    footer .border-t.pt-8 {
        text-align: center;
    }
}

/* ---- WooCommerce Cart & Checkout ---- */
@media screen and (max-width: 640px) {
    .woocommerce-cart .shop_table,
    .woocommerce-checkout .shop_table {
        font-size: 13px !important;
    }
    .woocommerce-cart .shop_table img {
        max-width: 60px !important;
        height: auto !important;
    }
    .woocommerce form .form-row {
        width: 100% !important;
        float: none !important;
    }
    .woocommerce-checkout .col2-set .col-1,
    .woocommerce-checkout .col2-set .col-2 {
        width: 100% !important;
        float: none !important;
    }
}

/* ---- Admin Bar offset for sticky header ---- */
@media screen and (max-width: 782px) {
    .admin-bar #site-header.sticky {
        top: 46px !important;
    }
}

/* ---- Accessibility: Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
