/* ================================================
   EPIDERMIST — Responsive Styles
   ================================================ */

/* ── 1440px ── */
@media (max-width: 1440px) {
    :root {
        --ep-container-padding: 36px;
    }
    h1 { font-size: 52px; }
    h2 { font-size: 40px; }
}

/* ── 1280px ── */
@media (max-width: 1280px) {
    :root {
        --ep-section-padding: 100px;
    }
    h1 { font-size: 48px; }
    h2 { font-size: 36px; }

    .ep-hero__heading { font-size: 48px; }

    .ep-product-grid,
    .woocommerce ul.products {
        gap: 24px;
    }

    .ep-footer__grid {
        gap: 40px;
    }
}

/* ── 1024px ── */
@media (max-width: 1024px) {
    :root {
        --ep-section-padding: 80px;
        --ep-grid-gap: 24px;
    }

    h1 { font-size: 42px; }
    h2 { font-size: 36px; }
    h3 { font-size: 24px; }

    .ep-hero { min-height: 80vh; }
    .ep-hero__heading { font-size: 42px; }

    /* Product grid: 3 columns */
    .ep-product-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Approach cards: 2 columns */
    .ep-about-approach__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Two-column layouts: reduce gap */
    .ep-brand-intro__grid,
    .ep-about-story__grid,
    .ep-concern-section__grid,
    .ep-contact-content__grid {
        gap: 60px;
    }

    /* Footer: 2x2 */
    .ep-footer__grid {
        grid-template-columns: 1.5fr 1fr;
        gap: 40px 60px;
    }

    /* WooCommerce single */
    .woocommerce div.product {
        gap: 40px;
    }

    .woocommerce div.product .product_title {
        font-size: 30px;
    }

    /* Related products */
    .woocommerce div.product .related ul.products,
    .woocommerce div.product .up-sells ul.products {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Cart totals */
    .woocommerce .cart_totals {
        width: 350px;
    }

    /* Checkout */
    .woocommerce form.checkout {
        gap: 40px;
    }
}

/* ── 768px (Tablet) ── */
@media (max-width: 768px) {
    :root {
        --ep-section-padding: 60px;
        --ep-container-padding: 24px;
    }

    h1 { font-size: 36px; }
    h2 { font-size: 30px; }
    h3 { font-size: 22px; }

    /* Header: mobile layout */
    .ep-header {
        height: 64px;
    }
    .ep-header--scrolled {
        height: 56px;
    }
    .ep-header__nav {
        display: none;
    }
    .ep-header__mobile-toggle {
        display: flex;
    }
    .ep-header__action-btn.ep-search-toggle,
    .ep-header__action-btn.ep-account-link {
        display: none;
    }

    /* Hero */
    .ep-hero {
        min-height: 70vh;
    }
    .ep-hero__heading {
        font-size: 36px;
    }
    .ep-hero__subtext {
        font-size: 16px;
    }
    .ep-hero__content {
        text-align: center;
    }
    .ep-hero__ctas {
        justify-content: center;
    }

    /* Product grid: auto-centering flex */
    .ep-product-grid,
    .woocommerce ul.products {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 20px !important;
    }

    /* All two-column layouts: stack */
    .ep-brand-intro__grid,
    .ep-brand-intro-grid,
    .ep-about-story__grid,
    .ep-concern-section__grid,
    .ep-contact-content__grid,
    .ep-philosophy__grid,
    .ep-brand-philosophy-grid {
        grid-template-columns: 1fr !important;
        gap: 36px !important;
    }

    .ep-concern-section--reversed .ep-concern-section__grid {
        direction: ltr !important;
    }

    /* Skin concern cards: 2 columns on tablet */
    .ep-concerns-grid,
    .ep-concern-cards__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    /* Brand philosophy: stack */
    .ep-philosophy__grid,
    .ep-brand-philosophy-grid {
        grid-template-columns: 1fr !important;
    }

    /* Visual Statement */
    .ep-visual-statement {
        height: 350px;
    }
    .ep-visual-statement__heading {
        font-size: 32px;
    }

    /* About approach: single column */
    .ep-about-approach__grid {
        grid-template-columns: 1fr;
    }

    /* Footer: single column */
    .ep-footer__grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .ep-footer__desc {
        max-width: none;
    }
    .ep-footer__social {
        justify-content: center;
    }

    /* Footer newsletter: stack */
    .ep-footer__newsletter-inner {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    .ep-footer__newsletter-form {
        width: 100%;
    }
    .ep-footer__newsletter-form input {
        width: 100%;
    }

    /* Footer bottom: stack */
    .ep-footer__bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    /* Contact info */
    .ep-contact-content__info {
        padding-top: 0;
    }

    /* Shop hero */
    .ep-shop-hero {
        padding: 120px 0 48px;
    }

    /* WooCommerce single product: stack */
    .woocommerce div.product {
        display: block;
        padding-top: 80px;
    }
    .woocommerce div.product .summary {
        position: static;
        margin-top: 32px;
    }
    .woocommerce div.product .product_title {
        font-size: 28px;
    }

    .woocommerce div.product .related ul.products,
    .woocommerce div.product .up-sells ul.products {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Cart */
    .woocommerce-cart .woocommerce {
        padding-top: 80px;
    }
    .woocommerce .cart_totals {
        float: none;
        width: 100%;
        margin-top: 32px;
    }

    /* Checkout: single column */
    .woocommerce-checkout .woocommerce {
        padding-top: 80px;
    }
    .woocommerce form.checkout {
        display: block;
    }
    .woocommerce #order_review {
        position: static;
        margin-top: 40px;
    }

    /* My Account: vertical nav */
    .woocommerce-account .woocommerce {
        padding-top: 80px;
    }
    .woocommerce-account .woocommerce-MyAccount-navigation ul {
        flex-direction: column;
        border-bottom: none;
    }
    .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        border-bottom: 1px solid var(--ep-border-light);
        border-left: 2px solid transparent;
    }
    .woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
        border-bottom-color: var(--ep-border-light);
        border-left-color: var(--ep-accent);
    }

    .woocommerce-account .woocommerce-Addresses {
        grid-template-columns: 1fr;
    }

    /* Newsletter form: stack */
    .ep-newsletter__form {
        flex-direction: column;
    }

    /* Page hero sizes */
    .ep-page-hero { min-height: 40vh; }
    .ep-page-hero--about { min-height: 45vh; }
    .ep-page-hero--contact { min-height: 35vh; }
    .ep-page-hero__content h1 { font-size: 36px; }

    /* Posts grid */
    .ep-posts-grid {
        grid-template-columns: 1fr;
    }

    /* Single post */
    .ep-single-post {
        padding-top: 80px;
    }
    .ep-single-post__title {
        font-size: 36px;
    }

    /* 404 */
    .ep-404 {
        padding-top: 120px;
    }
    .ep-404__content h1 {
        font-size: 80px;
    }
    .ep-404__actions {
        flex-direction: column;
        align-items: center;
    }

    /* Form half rows: stack */
    .ep-form-row--half {
        grid-template-columns: 1fr;
    }

    /* Concern products grid */
    .ep-concern-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── 480px ── */
@media (max-width: 480px) {
    h1 { font-size: 32px; }
    h2 { font-size: 28px; }
    h3 { font-size: 22px; }

    body {
        font-size: 15px;
    }

    .ep-hero {
        min-height: 60vh;
    }
    .ep-hero__heading {
        font-size: 32px;
    }
    .ep-hero__ctas {
        flex-direction: column;
        width: 100%;
    }
    .ep-hero__btn {
        width: 100%;
        text-align: center;
    }

    /* Buttons full width where needed */
    .ep-btn-primary,
    .ep-btn-secondary {
        padding: 14px 32px;
    }

    /* Product cards */
    .ep-product-card__info {
        padding: 16px;
    }
    .ep-product-card__title {
        font-size: 14px;
    }
    .ep-product-card__price {
        font-size: 14px;
    }

    .ep-product-grid,
    .woocommerce ul.products {
        gap: 16px;
    }

    /* Skin concern cards: single column */
    .ep-concerns-grid,
    .ep-concern-cards__grid,
    .ep-about-approach__grid {
        grid-template-columns: 1fr !important;
    }

    /* Cart */
    .woocommerce table.shop_table td.product-thumbnail img {
        width: 60px;
        height: 60px;
    }

    /* Footer padding */
    .ep-footer__main {
        padding: 60px 0 40px;
    }

    /* Page hero */
    .ep-page-hero__content h1 {
        font-size: 30px;
    }

    /* Visual statement */
    .ep-visual-statement {
        height: 300px;
    }
    .ep-visual-statement__heading {
        font-size: 28px;
    }

    /* WC Single product */
    .woocommerce div.product p.price,
    .woocommerce div.product span.price {
        font-size: 20px;
    }

    .woocommerce div.product form.cart {
        flex-direction: column;
    }

    .woocommerce div.product form.cart .single_add_to_cart_button {
        width: 100%;
    }

    /* Checkout */
    .woocommerce #order_review {
        padding: 24px;
    }

    /* Tabs: scrollable */
    .woocommerce div.product .woocommerce-tabs ul.tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        white-space: nowrap;
        padding: 12px 16px;
        font-size: 12px;
    }
}

/* ── 390px ── */
@media (max-width: 390px) {
    .ep-hero {
        min-height: 55vh;
    }
    .ep-hero__heading {
        font-size: 28px;
    }

    .ep-page-hero__content h1 {
        font-size: 28px;
    }

    .ep-approach-card {
        padding: 28px 20px;
    }

    .ep-product-grid,
    .woocommerce ul.products {
        gap: 12px;
    }

    .ep-product-card__info {
        padding: 12px;
    }

    .ep-product-card__title {
        font-size: 13px;
    }

    .ep-btn-primary,
    .ep-btn-secondary {
        padding: 13px 24px;
        font-size: 12px;
    }

    .ep-mobile-nav {
        width: 100%;
    }
}

/* ── 360px ── */
@media (max-width: 360px) {
    :root {
        --ep-container-padding: 16px;
    }

    h1 { font-size: 26px; }
    h2 { font-size: 24px; }

    .ep-hero__heading {
        font-size: 26px;
    }

    .ep-product-grid,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ep-product-card__info {
        padding: 10px;
    }

    .ep-product-card__title {
        font-size: 12px;
    }

    .ep-product-card__price {
        font-size: 13px;
    }

    .ep-product-card__actions .button,
    .ep-product-card__actions .add_to_cart_button {
        font-size: 10px;
    }

    .woocommerce table.shop_table {
        font-size: 13px;
    }

    .woocommerce .coupon {
        flex-direction: column;
    }

    .woocommerce .coupon input {
        max-width: none;
    }

    .woocommerce .cart_totals {
        padding: 20px;
    }
}

/* ── Touch targets for all mobile ── */
@media (max-width: 768px) {
    button,
    .ep-btn-primary,
    .ep-btn-secondary,
    .ep-header__action-btn,
    .ep-mobile-nav__list .menu-item a,
    input[type="submit"],
    .woocommerce .button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ── Ensure no horizontal overflow ── */
html, body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Overflow tables ── */
.woocommerce table {
    display: table;
}

@media (max-width: 480px) {
    .woocommerce table.shop_table_responsive thead {
        display: none;
    }

    .woocommerce table.shop_table_responsive tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--ep-border-light);
        border-radius: var(--ep-radius-md);
        padding: 16px;
    }

    .woocommerce table.shop_table_responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
        padding: 8px 0;
    }

    .woocommerce table.shop_table_responsive td::before {
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
}
