/**
 * Responsive — Layout shift media queries only.
 *
 * Font sizes and spacing are handled by vw/vh + clamp() in variables.css.
 * These queries handle structural layout changes (column counts, visibility toggles).
 *
 * @package WB_Developer_Theme
 */

/* === Mobile: up to 480px === */
@media (max-width: 480px) {

    /* ── Container ──────────────────────────────────── */
    .wb-container {
        width: 92vw;
        padding-left: 4vw;
        padding-right: 4vw;
    }

    /* ── Grids → single column ─────────────────────── */
    .wb-grid-2,
    .wb-grid-3,
    .wb-grid-4 {
        grid-template-columns: 1fr;
    }

    /* ── Header / Nav ──────────────────────────────── */
    .wb-header-inner {
        width: 92vw;
        padding: 0 4vw;
    }

    .wb-logo-img {
        height: clamp(42px, 12vw, 55px) !important;
        max-height: clamp(42px, 12vw, 55px) !important;
        max-width: clamp(140px, 38vw, 200px);
    }

    .wb-header.scrolled .wb-logo-img {
        height: clamp(36px, 10vw, 45px) !important;
        max-height: clamp(36px, 10vw, 45px) !important;
    }

    .wb-hamburger {
        width: clamp(28px, 7vw, 36px);
        height: clamp(28px, 7vw, 36px);
    }

    .wb-nav {
        width: 85vw;
        max-width: none;
        padding-left: 6vw;
        padding-right: 6vw;
    }

    .wb-nav-list {
        gap: 4vw;
    }

    .wb-nav-list li a {
        font-size: clamp(16px, 4.5vw, 20px);
    }

    .wb-cart-count {
        top: -2vw;
        right: -2vw;
        width: clamp(16px, 4.5vw, 22px);
        height: clamp(16px, 4.5vw, 22px);
    }

    /* ── Hero ──────────────────────────────────────── */
    .wb-hero {
        min-height: 85vh;
    }

    .wb-hero-inner {
        max-width: 90vw;
        padding: 6vw;
    }

    .wb-hero-subheading {
        max-width: 90vw;
    }

    .wb-hero-cta .wb-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Page Hero (inner pages) ───────────────────── */
    .wb-page-hero {
        padding-top: calc(var(--header-height) + 6vw);
        padding-bottom: 6vw;
    }

    .wb-bio-hero {
        padding-top: calc(var(--header-height) + 6vw);
        padding-bottom: 6vw;
    }

    /* ── Section spacing ───────────────────────────── */
    .wb-section {
        padding-top: 6vw;
        padding-bottom: 6vw;
    }

    .wb-section-header {
        margin-bottom: 4vw;
    }

    .wb-section-subtitle {
        max-width: 90vw;
    }

    /* ── About Intro ───────────────────────────────── */
    .wb-about-intro-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .wb-about-intro-centered,
    .wb-about-intro-text {
        max-width: 90vw;
    }

    /* ── Bio Section ───────────────────────────────── */
    .wb-bio-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .wb-bio-image {
        position: static;
        max-width: 60vw;
        margin: 0 auto;
    }

    .wb-bio-image-frame img {
        aspect-ratio: 1 / 1;
    }

    .wb-bio-text,
    .wb-bio-text-centered,
    .wb-teaching-bg-content,
    .wb-featured-quote {
        max-width: 90vw;
    }

    /* ── Video Section (homepage) ───────────────────── */
    .wb-video-wrapper {
        max-width: 90vw;
    }

    /* ── Certification CTA ─────────────────────────── */
    .wb-cert-cta-text {
        max-width: 90vw;
    }

    .wb-cert-cta .wb-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Testimonials ──────────────────────────────── */
    .wb-testimonial-author {
        flex-direction: column;
        gap: 2vw;
    }

    /* ── Newsletter ────────────────────────────────── */
    .wb-newsletter-form,
    .wb-newsletter-form-inline {
        flex-direction: column;
        max-width: 90vw;
    }

    .wb-newsletter-form-inline .wb-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Contact Page ──────────────────────────────── */
    .wb-contact-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .wb-contact-form-wrapper {
        padding: 4vw;
    }

    /* ── 404 Page ──────────────────────────────────── */
    .wb-404-inner {
        max-width: 90vw;
    }

    .wb-404-search {
        flex-direction: column;
    }

    .wb-404-search .wb-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Touch-friendly form elements ──────────────── */
    .wb-input,
    .wb-textarea,
    .wb-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    textarea,
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS auto-zoom */
    }

    .wb-btn,
    button[type="submit"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* ── Content / Blog ────────────────────────────── */
    .wb-content-narrow {
        max-width: 90vw;
    }

    .wb-article-meta-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .wb-article-meta-right {
        flex-wrap: wrap;
    }

    .wb-post-nav {
        flex-direction: column;
    }

    .wb-post-nav-link {
        max-width: 100%;
    }

    .wb-post-nav-next {
        text-align: left;
    }

    /* ── Videos Page ───────────────────────────────── */
    .wb-video-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .wb-video-search {
        width: 100%;
    }

    .wb-video-filters {
        justify-content: center;
    }

    .wb-filter-pill {
        font-size: clamp(12px, 3.5vw, 14px);
        padding: 2vw 4vw;
    }

    .wb-video-grid {
        grid-template-columns: 1fr;
    }

    .wb-video-modal-content {
        width: 95vw;
    }

    .wb-video-modal-close {
        top: -10vw;
        font-size: clamp(24px, 7vw, 32px);
    }

    /* ── Books Page (archive) ──────────────────────── */
    .wb-books-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .wb-books-filter {
        gap: 2vw;
    }

    .wb-filter-btn {
        font-size: clamp(12px, 3.5vw, 14px);
        padding: 2vw 3vw;
    }

    .wb-shop-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 2vw;
    }

    /* ── Single Product ────────────────────────────── */
    .wb-product-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .wb-product-gallery {
        position: static;
        max-width: 100%;
        width: 100%;
    }

    .wb-gallery-carousel {
        width: 100%;
    }

    .wb-gallery-img {
        aspect-ratio: 3 / 4;
        object-fit: contain;
    }

    .wb-product-info {
        width: 100%;
        min-width: 0;
    }

    .wb-product-header {
        flex-direction: column;
        gap: 2vw;
    }

    .wb-product-title {
        font-size: clamp(22px, 6vw, 30px);
        word-break: break-word;
    }

    .wb-product-price {
        font-size: clamp(20px, 5.5vw, 26px);
    }

    .wb-product-formats-label {
        font-size: clamp(12px, 3.5vw, 14px);
    }

    .wb-format-options {
        grid-template-columns: 1fr;
        gap: 3vw;
    }

    .wb-format-card {
        padding: 3vw;
        gap: 3vw;
    }

    .wb-format-card-icon {
        width: clamp(24px, 7vw, 32px);
        height: clamp(24px, 7vw, 32px);
    }

    .wb-format-card-name {
        font-size: clamp(13px, 3.8vw, 15px);
    }

    .wb-format-card-price {
        font-size: clamp(13px, 3.8vw, 15px);
    }

    .wb-format-card.active::after {
        width: clamp(18px, 5vw, 22px);
        height: clamp(18px, 5vw, 22px);
        top: 2vw;
        right: 2vw;
    }

    .wb-product-links {
        flex-direction: column;
    }

    .wb-product-links .wb-btn {
        width: 100%;
        justify-content: center;
    }

    .wb-product-meta-details {
        overflow-x: hidden;
    }

    .wb-meta-row {
        gap: 2vw;
    }

    .wb-meta-label,
    .wb-meta-value {
        font-size: clamp(12px, 3.5vw, 14px);
    }

    .wb-meta-value {
        text-align: right;
        word-break: break-word;
    }

    .wb-tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        flex-wrap: nowrap;
        gap: 0;
    }

    .wb-tab-btn {
        flex-shrink: 0;
        font-size: clamp(13px, 3.5vw, 15px);
        padding: 3vw 4vw;
    }

    .wb-product-add-to-cart {
        width: 100%;
    }

    .wb-product-add-to-cart .woocommerce-variation-add-to-cart,
    .wb-product-add-to-cart form.cart:not(.variations_form) {
        flex-direction: column;
        width: 100%;
    }

    .wb-product-add-to-cart .quantity,
    .wb-qty-wrapper {
        width: 100%;
        justify-content: center;
    }

    .wb-product-add-to-cart .single_add_to_cart_button,
    .wb-product-add-to-cart .woocommerce-variation-add-to-cart .button {
        width: 100%;
        justify-content: center;
    }

    .wb-product-thumbnails {
        justify-content: center;
        flex-wrap: wrap;
    }

    .wb-product-thumb {
        width: clamp(50px, 14vw, 70px);
        height: clamp(50px, 14vw, 70px);
    }

    /* Related products */
    .wb-related-products .wb-grid-3 {
        grid-template-columns: 1fr;
    }

    /* ── Cart Page ─────────────────────────────────── */
    .wb-cart-layout {
        grid-template-columns: 1fr;
    }

    .wb-cart-header-row {
        display: none;
    }

    .wb-cart-item {
        grid-template-columns: 1fr;
        gap: 2vw;
        padding: 4vw 0;
    }

    .wb-cart-col-product {
        flex-direction: column;
        align-items: flex-start;
    }

    .wb-cart-product-thumb {
        width: clamp(60px, 20vw, 90px);
    }

    .wb-cart-col-price,
    .wb-cart-col-qty,
    .wb-cart-col-subtotal {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .wb-cart-col-price::before,
    .wb-cart-col-qty::before,
    .wb-cart-col-subtotal::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: var(--text-sm);
        color: var(--color-text-secondary);
    }

    .wb-cart-col-remove {
        text-align: right;
    }

    .wb-cart-actions {
        flex-direction: column;
    }

    .wb-coupon-form {
        flex-direction: column;
    }

    .wb-coupon-form .wb-input {
        width: 100%;
    }

    .wb-cart-totals {
        position: static;
    }

    /* ── Checkout Page ─────────────────────────────── */
    .wb-checkout-layout {
        grid-template-columns: 1fr;
    }

    .wb-checkout-order-review {
        position: static;
    }

    .wc-block-checkout__actions {
        flex-direction: column-reverse !important;
    }

    /* ── Thank You Page ────────────────────────────── */
    .wb-thankyou {
        max-width: 90vw;
    }

    .wb-form-pay {
        max-width: 90vw;
    }

    .wb-order-overview-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* ── My Account ────────────────────────────────── */
    .woocommerce-account .woocommerce-MyAccount-navigation,
    .woocommerce-account .woocommerce-MyAccount-content {
        width: 100%;
        float: none;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        margin-bottom: 4vw;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul {
        display: flex;
        flex-wrap: wrap;
        gap: 2vw;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li {
        margin-bottom: 0;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        white-space: nowrap;
        font-size: clamp(12px, 3.5vw, 14px);
    }

    /* ── Mini Cart ─────────────────────────────────── */
    .wb-mini-cart-buttons {
        flex-direction: column;
    }

    /* ── Add-to-Cart Popup ─────────────────────────── */
    .wb-cart-popup {
        max-width: 85vw;
    }

    .wb-cart-popup-actions {
        flex-direction: column;
    }

    .wb-cart-popup-actions .wb-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Certification Page ─────────────────────────── */
    .wb-cert-overview__header {
        max-width: 90vw;
    }

    .wb-cert-overview__benefits {
        grid-template-columns: 1fr;
    }

    .wb-cert-process__steps {
        grid-template-columns: 1fr;
    }

    .wb-exam-gate {
        max-width: 90vw;
    }

    .wb-exam-info__stats {
        flex-direction: column;
        align-items: center;
    }

    .wb-exam-info__stat {
        width: 100%;
    }

    .wb-exam-app {
        max-width: 90vw;
    }

    /* ── Verification Page ─────────────────────────── */
    .wb-verification-page .wb-container {
        max-width: 90vw;
    }

    .wb-verify__input-group {
        flex-direction: column;
        max-width: 90vw;
    }

    .wb-verify__result {
        max-width: 90vw;
    }

    /* ── Dashboard Page ────────────────────────────── */
    .wb-dashboard-page .wb-container {
        max-width: 90vw;
    }

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

    .wb-dash__tabs {
        flex-wrap: wrap;
    }

    .wb-dash-gate {
        max-width: 90vw;
    }

    /* ── Footer ────────────────────────────────────── */
    .wb-footer-inner {
        width: 92vw;
        padding: 0 4vw;
    }

    .wb-footer-columns {
        grid-template-columns: 1fr;
        gap: 6vw;
    }

    .wb-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 3vw;
    }

    .wb-footer-social {
        justify-content: center;
    }

    /* ── Notifications ─────────────────────────────── */
    .wb-notifications {
        max-width: 90vw;
        right: 5vw;
        left: 5vw;
    }

    /* ── Back to Top ───────────────────────────────── */
    .wb-back-to-top {
        bottom: 4vw;
        right: 4vw;
        width: clamp(40px, 11vw, 48px);
        height: clamp(40px, 11vw, 48px);
    }
}

/* === Tablet: 481px to 768px === */
@media (min-width: 481px) and (max-width: 768px) {
    .wb-grid-3,
    .wb-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .wb-about-intro-grid {
        grid-template-columns: 1fr;
    }

    .wb-about-intro-centered,
    .wb-about-intro-text {
        max-width: 80vw;
    }

    .wb-newsletter-form-inline {
        max-width: 60vw;
    }

    .wb-hero-inner {
        max-width: 80vw;
    }

    .wb-video-wrapper {
        max-width: 80vw;
    }

    .wb-bio-grid {
        grid-template-columns: 1fr;
    }

    .wb-bio-text,
    .wb-bio-text-centered,
    .wb-teaching-bg-content,
    .wb-featured-quote {
        max-width: 80vw;
    }

    .wb-contact-grid {
        grid-template-columns: 1fr;
    }

    .wb-content-narrow {
        max-width: 80vw;
    }

    /* Videos — Tablet */
    .wb-video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* WooCommerce — Tablet */
    .wb-product-grid {
        grid-template-columns: 1fr;
    }

    .wb-cart-layout {
        grid-template-columns: 1fr;
    }

    .wb-checkout-layout {
        grid-template-columns: 1fr;
    }

    .wb-thankyou {
        max-width: 80vw;
    }

    .wb-form-pay {
        max-width: 80vw;
    }

    /* Certification — Tablet */
    .wb-cert-overview__header {
        max-width: 80vw;
    }

    .wb-cert-overview__benefits {
        grid-template-columns: repeat(2, 1fr);
    }

    .wb-cert-process__steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .wb-exam-app {
        max-width: 80vw;
    }

    /* Verification — Tablet */
    .wb-verification-page .wb-container {
        max-width: 80vw;
    }

    .wb-verify__input-group {
        max-width: 70vw;
    }

    .wb-verify__result {
        max-width: 70vw;
    }

    /* Dashboard — Tablet */
    .wb-dashboard-page .wb-container {
        max-width: 85vw;
    }

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

/* === Laptop and below: up to 1024px — Mobile nav === */
@media (max-width: 1024px) {
    .wb-hamburger {
        display: flex;
    }

    .wb-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75vw;
        max-width: 350px;
        height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: calc(var(--header-height) + 2vw);
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
        box-shadow: var(--shadow-lg);
        transition: right var(--transition-base);
        z-index: 999;
        overflow-y: auto;
    }

    .wb-nav.active {
        right: 0;
    }

    .wb-nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
        width: 100%;
    }

    .wb-nav-list li a,
    .home .wb-header:not(.scrolled) .wb-nav-list li a,
    .has-hero-header .wb-header:not(.scrolled) .wb-nav-list li a {
        font-size: var(--text-md);
        color: var(--color-text-primary);
    }

    .wb-nav-list li a:hover,
    .wb-nav-list li.current-menu-item a,
    .home .wb-header:not(.scrolled) .wb-nav-list li a:hover,
    .home .wb-header:not(.scrolled) .wb-nav-list li.current-menu-item a,
    .has-hero-header .wb-header:not(.scrolled) .wb-nav-list li a:hover,
    .has-hero-header .wb-header:not(.scrolled) .wb-nav-list li.current-menu-item a {
        color: var(--color-gold);
    }

    /* Submenu links inside mobile nav */
    .wb-nav-list .sub-menu li a,
    .home .wb-header:not(.scrolled) .wb-nav-list .sub-menu li a,
    .has-hero-header .wb-header:not(.scrolled) .wb-nav-list .sub-menu li a {
        color: var(--color-text-secondary);
    }

    .wb-nav-list li.menu-item-has-children > .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: var(--spacing-sm);
    }

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

    .wb-section-subtitle {
        max-width: 90vw;
    }

    /* Product grid → single column on small tablets */
    .wb-product-grid {
        grid-template-columns: 1fr;
    }
}

/* === Desktop: 1025px and up === */
@media (min-width: 1025px) {
    .wb-hamburger {
        display: none;
    }

    .wb-nav {
        position: static;
        width: auto;
        height: auto;
        background: none;
        box-shadow: none;
        padding: 0;
        flex-direction: row;
    }
}

/* === Wide / 4K: 1441px+ === */
@media (min-width: 1441px) {
    :root {
        --container-width: 80vw;
    }
}
