/**
 * Responsive Breakpoints
 *
 * Mobile-first approach optimized for Indian mobile users (70%+ traffic).
 *
 * Breakpoints:
 * - Base:    0–575px    (mobile portrait)
 * - sm:      576–767px  (mobile landscape)
 * - md:      768–991px  (tablet)
 * - lg:      992–1199px (small desktop)
 * - xl:      1200px+    (desktop)
 *
 * @package Good_Origins
 */

/* ==========================================================================
   Small Mobile (up to 575px) — base styles live in main.css / woocommerce.css
   ========================================================================== */

@media (max-width: 575px) {

    /* Layout */
    .go-container {
        padding-inline: 16px;
    }

    /* Header — hide desktop nav, show hamburger */
    .go-header__nav {
        display: none;
    }

    .go-header__menu-toggle {
        display: flex;
    }

    /* Hide wishlist on mobile */
    .go-desktop-only {
        display: none !important;
    }

    .go-header__inner {
        height: 56px;
        padding-inline: 12px;
    }

    .go-header__logo img {
        max-height: 32px;
    }

    .go-header__actions {
        gap: 2px;
    }

    .go-header__action-btn {
        width: 36px;
        height: 36px;
    }

    .go-header__action-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Mobile bottom bar — show */
    .go-mobile-bottom-bar {
        display: flex;
    }

    /* Announcement Bar */
    .go-announcement {
        font-size: 12px;
        padding: 6px 0;
    }

    /* Hero */
    .go-hero {
        padding: 120px 0 60px;
        min-height: auto;
    }

    .go-hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .go-hero .go-hero__title {
        font-size: 2.2rem;
    }

    .go-hero-desc {
        font-size: 0.95rem;
    }

    .go-hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .go-hero-stats {
        gap: 24px;
    }

    .go-hero-stat-num {
        font-size: 1.5rem;
    }

    .go-hero-visual {
        display: none;
    }

    /* Trust Bar */
    .go-trust-bar {
        padding: 16px 0;
    }

    .go-trust-bar__items {
        gap: 16px;
        flex-direction: column;
        align-items: center;
    }

    .go-trust-bar__icon {
        width: 32px;
        height: 32px;
    }

    /* Category Grid */
    .go-category-grid__items {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .go-category-grid__title {
        font-size: 0.75rem;
    }

    /* Product Grid */
    .go-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .go-product-card__title {
        font-size: 0.8rem;
    }

    .go-product-card__price {
        font-size: 0.85rem;
    }

    .go-product-card__actions {
        flex-direction: column;
        gap: 4px;
    }

    .go-product-card__add-to-cart {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Product Carousel */
    .go-product-carousel__track {
        gap: 12px;
    }

    .go-product-carousel__item {
        min-width: 160px;
    }

    /* Section Headings */
    .go-section__title {
        font-size: 1.5rem;
    }

    .go-section__subtitle {
        font-size: 0.85rem;
    }

    /* Brand Story */
    .go-brand-story {
        padding: 40px 0;
    }

    .go-brand-story__title {
        font-size: 1.5rem;
    }

    .go-brand-story__text {
        font-size: 0.9rem;
    }

    /* Testimonials */
    .go-testimonials__grid {
        grid-template-columns: 1fr;
    }

    .go-testimonial__text {
        font-size: 0.9rem;
    }

    /* Concern Grid */
    .go-concern-grid__items {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Instagram Feed */
    .go-instagram__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    /* Newsletter */
    .go-newsletter__form {
        flex-direction: column;
    }

    .go-newsletter__form input[type="email"] {
        width: 100%;
    }

    .go-newsletter__form button {
        width: 100%;
    }

    /* Footer */
    .go-footer__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .go-footer__bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    /* Single Product */
    .go-single-product__layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .go-single-product__gallery {
        position: static;
    }

    .go-single-product__title {
        font-size: 1.25rem;
    }

    .go-single-product__price {
        font-size: 1.25rem;
    }

    .go-single-product__trust-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .go-single-product__trust-item {
        font-size: 0.75rem;
    }

    .go-single-product__share {
        flex-wrap: wrap;
    }

    .go-product-tabs__nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .go-product-tabs__nav::-webkit-scrollbar {
        display: none;
    }

    .go-product-tabs__tab {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    /* Gallery Thumbnails */
    .go-single-product__thumbs {
        gap: 6px;
    }

    .go-single-product__thumb {
        width: 50px;
        height: 50px;
    }

    /* Cart Page */
    .woocommerce-cart .go-cart-table {
        display: block;
    }

    .woocommerce-cart .go-cart-table thead {
        display: none;
    }

    .woocommerce-cart .go-cart-table tbody,
    .woocommerce-cart .go-cart-table tr,
    .woocommerce-cart .go-cart-table td {
        display: block;
        width: 100%;
    }

    .woocommerce-cart .go-cart-table tr {
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid var(--go-border);
        border-radius: 8px;
        position: relative;
    }

    .woocommerce-cart .go-cart-table td::before {
        content: attr(data-title);
        display: block;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--go-text-light);
        margin-bottom: 4px;
    }

    .woocommerce-cart .cart_totals {
        width: 100%;
    }

    /* Checkout */
    .go-checkout__layout {
        grid-template-columns: 1fr;
    }

    .go-checkout__order-summary {
        order: -1;
    }

    /* My Account */
    .go-myaccount__layout {
        grid-template-columns: 1fr;
    }

    .go-myaccount__nav {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--go-border);
        border-right: none;
        padding-right: 0;
        padding-bottom: 0;
    }

    .go-myaccount__nav a {
        white-space: nowrap;
        padding: 10px 16px;
    }

    /* Quick View Modal */
    .go-quick-view {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }

    .go-quick-view__gallery,
    .go-quick-view__info {
        width: 100%;
    }

    /* Cart Drawer */
    .go-cart-drawer {
        width: 100%;
        max-width: 100%;
    }

    /* Search Overlay */
    .go-search-overlay__input {
        font-size: 1rem;
    }

    /* Blog */
    .go-blog-grid {
        grid-template-columns: 1fr;
    }

    /* 404 */
    .go-404__title {
        font-size: 4rem;
    }
}


/* ==========================================================================
   Mobile Landscape (576px – 767px)
   ========================================================================== */

@media (min-width: 576px) and (max-width: 767px) {

    .go-container {
        padding-inline: 20px;
    }

    /* Header — hide desktop nav, show hamburger */
    .go-header__nav {
        display: none;
    }

    .go-header__menu-toggle {
        display: flex;
    }

    /* Hide wishlist on mobile landscape */
    .go-desktop-only {
        display: none !important;
    }

    /* Mobile bottom bar — show */
    .go-mobile-bottom-bar {
        display: flex;
    }

    .go-hero .go-hero__title {
        font-size: 2.4rem;
    }

    .go-hero-visual {
        display: none;
    }

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

    .go-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

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

    .go-testimonials__grid {
        grid-template-columns: 1fr;
    }

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

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

    .go-single-product__layout {
        grid-template-columns: 1fr;
    }

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


/* ==========================================================================
   Tablet (768px – 991px)
   ========================================================================== */

@media (min-width: 768px) {

    /* General */
    .go-container {
        padding-inline: 24px;
    }

    .go-section__title {
        font-size: 1.75rem;
    }

    /* Header */
    .go-header__inner {
        height: 64px;
    }

    /* Hide mobile bottom nav on tablet+ */
    .go-mobile-bar {
        display: none;
    }

    /* Hero */
    .go-hero {
        min-height: auto;
        padding: 140px 0 80px;
    }

    .go-hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }

    .go-hero .go-hero__title {
        font-size: 2.75rem;
    }

    .go-hero-visual {
        display: block;
        height: 480px;
    }

    .go-hero-img-main {
        width: 300px;
        height: 380px;
    }

    .go-hero-img-secondary {
        width: 200px;
        height: 250px;
    }

    /* Product Grid */
    .go-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    /* Category Grid */
    .go-category-grid__items {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Concern Grid */
    .go-concern-grid__items {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Testimonials */
    .go-testimonials__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Instagram */
    .go-instagram__grid {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Footer */
    .go-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Quick View */
    .go-quick-view {
        flex-direction: row;
    }

    .go-quick-view__gallery {
        width: 50%;
    }

    .go-quick-view__info {
        width: 50%;
    }

    /* Cart Drawer */
    .go-cart-drawer {
        max-width: 400px;
    }

    /* Blog */
    .go-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Single Product */
    .go-single-product__layout {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .go-single-product__gallery {
        position: sticky;
        top: 80px;
    }

    /* Cart Page */
    .go-cart-layout {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 32px;
        align-items: start;
    }

    /* Checkout */
    .go-checkout__layout {
        display: grid;
        grid-template-columns: 1fr 380px;
        gap: 32px;
    }

    /* My Account */
    .go-myaccount__layout {
        display: grid;
        grid-template-columns: 220px 1fr;
        gap: 32px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {

    /* Show desktop nav if space, otherwise keep hamburger */
    .go-header__nav {
        display: none;
    }

    .go-header__menu-toggle {
        display: flex;
    }

    /* Hide wishlist on tablet */
    .go-desktop-only {
        display: none !important;
    }

    /* Mobile bottom bar — show on tablet */
    .go-mobile-bottom-bar {
        display: flex;
    }

    /* Adjust product grid for tablet */
    .go-product-card__actions {
        opacity: 1;
        transform: none;
    }

    /* Brand Story */
    .go-brand-story__inner {
        grid-template-columns: 1fr;
    }

    .go-brand-story__image {
        max-height: 300px;
    }
}


/* ==========================================================================
   Small Desktop (992px – 1199px)
   ========================================================================== */

@media (min-width: 992px) {

    /* Header: show desktop nav, hide hamburger */
    .go-header__nav {
        display: flex;
    }

    .go-header__menu-toggle {
        display: none;
    }

    /* Layout */
    .go-container {
        padding-inline: 32px;
    }

    .go-section__title {
        font-size: 2rem;
    }

    /* Hero */
    .go-hero {
        min-height: 100vh;
        padding: 160px 0 100px;
    }

    .go-hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 80px;
    }

    .go-hero .go-hero__title {
        font-size: 3.5rem;
    }

    .go-hero-visual {
        height: 580px;
    }

    .go-hero-img-main {
        width: 380px;
        height: 480px;
    }

    /* Product Grid */
    .go-product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    /* Category Grid */
    .go-category-grid__items {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Concern Grid */
    .go-concern-grid__items {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Testimonials */
    .go-testimonials__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Brand Story */
    .go-brand-story__inner {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
        align-items: center;
    }

    /* Footer */
    .go-footer__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Blog */
    .go-blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Shop Sidebar */
    .go-shop-layout {
        grid-template-columns: 260px 1fr;
    }

    /* Newsletter form inline */
    .go-newsletter__form {
        flex-direction: row;
        max-width: 500px;
        margin-inline: auto;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {

    /* Mega Menu: limit width */
    .go-mega-dropdown {
        max-width: 900px;
    }

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


/* ==========================================================================
   Desktop (1200px+)
   ========================================================================== */

@media (min-width: 1200px) {

    .go-container {
        max-width: 1280px;
        margin-inline: auto;
        padding-inline: 40px;
    }

    /* Hero */
    .go-hero .go-hero__title {
        font-size: 4rem;
    }

    /* Mega Menu */
    .go-mega-dropdown {
        max-width: 1100px;
    }

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

    /* Product Grid */
    .go-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Category Grid */
    .go-category-grid__items {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Concern Grid */
    .go-concern-grid__items {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    /* Checkout wider summary */
    .go-checkout__layout {
        grid-template-columns: 1fr 420px;
    }

    /* Single Product wider layout */
    .go-single-product__layout {
        grid-template-columns: 55% 1fr;
        gap: 48px;
    }
}


/* ==========================================================================
   Large Desktop (1400px+)
   ========================================================================== */

@media (min-width: 1400px) {

    .go-container {
        max-width: 1400px;
    }

    .go-hero .go-hero__title {
        font-size: 4.5rem;
    }
}


/* ==========================================================================
   Height-based adjustments (short viewports / landscape mobile)
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {

    .go-hero {
        min-height: 100vh;
    }

    .go-hero .go-hero__title {
        font-size: 1.75rem;
    }

    .go-mobile-menu {
        padding-top: 56px;
    }

    .go-quick-view {
        max-height: 95vh;
    }
}


/* ==========================================================================
   Touch Device Overrides
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {

    /* Always show product card actions on touch */
    .go-product-card__actions {
        opacity: 1;
        transform: translateY(0);
    }

    /* Disable image hover swap on touch */
    .go-product-card__image-secondary {
        display: none;
    }

    /* Larger touch targets */
    .go-product-card__wishlist-btn {
        width: 36px;
        height: 36px;
    }

    .go-quantity__btn {
        width: 36px;
        height: 36px;
    }

    /* Remove hover effects */
    .go-product-card:hover {
        transform: none;
    }

    .go-product-card:hover .go-product-card__image-primary {
        transform: none;
    }
}


/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    .go-announcement,
    .go-header,
    .go-mobile-bar,
    .go-cart-drawer,
    .go-search-overlay,
    .go-mobile-menu,
    .go-quick-view-modal,
    .go-newsletter,
    .go-instagram,
    .go-footer__bottom,
    .go-single-product__share,
    .go-single-product__sticky-bar,
    .go-product-card__actions,
    .go-breadcrumbs,
    .go-load-more,
    .go-shop-sidebar,
    .go-shop-toolbar__filter-btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .go-container {
        max-width: 100%;
        padding: 0;
    }

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

    .go-single-product__layout {
        grid-template-columns: 40% 1fr;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .go-footer a[href]::after {
        content: none;
    }

    img {
        max-width: 100% !important;
    }
}


/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .go-hero-grid {
        transition: none;
    }

    .go-announcement__marquee {
        animation: none;
    }

    .go-product-card,
    .go-product-card__image-primary {
        transition: none;
    }

    .go-animate {
        opacity: 1 !important;
        transform: none !important;
    }
}


/* ==========================================================================
   High Contrast / Forced Colors
   ========================================================================== */

@media (forced-colors: active) {

    .go-btn,
    .go-product-card__add-to-cart {
        border: 2px solid ButtonText;
    }

    .go-product-card__badge {
        border: 1px solid;
    }

    .go-stars svg {
        forced-color-adjust: none;
    }
}


/* ==========================================================================
   Dark Mode (future-ready)
   ========================================================================== */

@media (prefers-color-scheme: dark) {

    /* Only apply if theme supports dark mode (add .go-dark-mode class to html) */
    html.go-dark-mode {
        --go-primary: #4a8c2a;
        --go-secondary: #1a1a1a;
        --go-accent: #e07b3a;
        --go-text: #f0f0f0;
        --go-text-light: #b0b0b0;
        --go-bg: #121212;
        --go-bg-alt: #1e1e1e;
        --go-border: #333;
        --go-card-bg: #1e1e1e;
    }
}


/* ==========================================================================
   NEW SECTIONS — Responsive Overrides
   ========================================================================== */

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

    /* Ingredients Spotlight */
    .go-ingredient-row,
    .go-ingredient-row--reverse {
        flex-direction: column;
        gap: 24px;
        margin-bottom: 40px;
    }

    .go-ingredient-visual {
        flex: 0 0 auto;
    }

    .go-ingredient-visual img,
    .go-ingredient-placeholder {
        width: 200px;
        height: 200px;
    }

    .go-ingredient-info h3 {
        font-size: 1.3rem;
    }

    .go-ingredient-info p {
        font-size: 0.88rem;
    }

    .go-ingredient-label {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: -8px;
    }

    /* Transformation Stories */
    .go-transform-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .go-transform-info {
        padding: 16px;
    }

    .go-transform-info h4 {
        font-size: 1rem;
    }

    /* Press / As Seen In */
    .go-press {
        padding: 40px 0;
    }

    .go-press-logos {
        gap: 24px;
    }

    .go-press-logo {
        font-size: 1.1rem;
    }

    .go-press-logo--sans {
        font-size: 0.9rem;
    }

    /* Blog Feed */
    .go-blog-feed .go-blog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .go-blog-card__content {
        padding: 16px;
    }

    .go-blog-card__title {
        font-size: 1rem;
    }

    /* Product Grid 4col */
    .go-product-grid--4col {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* --- Mobile Landscape (576px – 767px) --- */
@media (min-width: 576px) and (max-width: 767px) {

    .go-ingredient-row,
    .go-ingredient-row--reverse {
        flex-direction: column;
        gap: 28px;
    }

    .go-ingredient-visual {
        flex: 0 0 auto;
    }

    .go-ingredient-visual img,
    .go-ingredient-placeholder {
        width: 240px;
        height: 240px;
    }

    .go-transform-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .go-blog-feed .go-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .go-product-grid--4col {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* --- Tablet (768px – 991px) --- */
@media (min-width: 768px) and (max-width: 991px) {

    .go-ingredient-row {
        gap: 32px;
    }

    .go-ingredient-visual {
        flex: 0 0 220px;
    }

    .go-ingredient-visual img,
    .go-ingredient-placeholder {
        width: 220px;
        height: 220px;
    }

    .go-ingredient-info h3 {
        font-size: 1.5rem;
    }

    .go-transform-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .go-blog-feed .go-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .go-product-grid--4col {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .go-press-logos {
        gap: 32px;
    }
}

/* --- Small Desktop (992px – 1199px) --- */
@media (min-width: 992px) and (max-width: 1199px) {

    .go-ingredient-row {
        gap: 40px;
    }

    .go-ingredient-visual {
        flex: 0 0 260px;
    }

    .go-ingredient-visual img,
    .go-ingredient-placeholder {
        width: 260px;
        height: 260px;
    }

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

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

    .go-product-grid--4col {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* --- Desktop (1200px+) — full layout as defined in main.css --- */
@media (min-width: 1200px) {

    .go-product-grid--4col {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}
