

@media (max-width: 640px) {

    /* Extra small screens */
    h1 {
        font-size: 1.75rem !important;
    }

    /* Product grid single column */
    .grid {
        grid-template-columns: 1fr !important;
    }

    #product-templates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Buttons full width */
    .flex.gap-2:not(.breadcrumb):not(.product-breadcrumb):not(.mobile-header-actions):not(.cart-item-top-row):not(.cart-item-actions):not(.privacy-consent-row):not(.product-quantity-row):not(.product-buying-note):not(.product-detail-list-row):not(.checkout-place-order-btn) {
        flex-direction: column !important;
    }

    .flex.gap-3:not(.breadcrumb):not(.product-breadcrumb):not(.mobile-header-actions):not(.cart-item-row):not(.privacy-consent-row):not(.product-quantity-row):not(.product-buying-note):not(.product-detail-list-row) {
        flex-direction: column !important;
    }

    .flex.gap-2:not(.breadcrumb):not(.product-breadcrumb):not(.mobile-header-actions):not(.cart-item-top-row):not(.cart-item-actions):not(.privacy-consent-row):not(.product-quantity-row):not(.product-buying-note):not(.product-detail-list-row):not(.checkout-place-order-btn)>*,
    .flex.gap-3:not(.breadcrumb):not(.product-breadcrumb):not(.mobile-header-actions):not(.cart-item-row):not(.privacy-consent-row):not(.product-quantity-row):not(.product-buying-note):not(.product-detail-list-row)>* {
        width: 100% !important;
    }

    .checkout-place-order-btn.flex.gap-2 {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        white-space: nowrap;
    }

    .checkout-place-order-btn.flex.gap-2 > * {
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
    }

    /* Form inputs */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .privacy-consent-row #privacy.custom-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        flex: 0 0 20px;
    }

    .contact-submit-btn {
        min-height: 3rem;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        white-space: nowrap;
    }

    .contact-submit-content {
        max-width: 100%;
        flex-wrap: nowrap;
    }

    /* Prevent zoom on iOS */

}

@media (max-width: 640px) {

    /* Extra small screens — homepage/marketing typography */
    .homepage h1 {
        font-size: 1.75rem !important;
    }

    /* Homepage/product grid single column on xs */
    .homepage .grid,
    .produtos-page .grid:not(.catalog-grid-two):not(.catalog-toolbar-grid):not(.product-quick-links) {
        grid-template-columns: 1fr !important;
    }

    .product-quick-links.grid.grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.35rem !important;
    }

    .product-quick-links.grid.grid-cols-3 > a {
        min-width: 0;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Homepage CTA buttons stacked */
    .homepage .flex.gap-2,
    .homepage .flex.gap-3 {
        flex-direction: column !important;
    }

    .homepage .flex.gap-2>*,
    .homepage .flex.gap-3>* {
        width: 100% !important;
    }

    /* Checkout form buttons stack */
    .checkout-page .flex.gap-2:not(.items-center),
    .checkout-page .flex.gap-3:not(.items-center) {
        flex-direction: column !important;
    }

    /* Form inputs — prevent iOS zoom on focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 768px) {
    body[data-analytics-event="view_product"] {
        overflow-x: hidden;
    }

    body[data-analytics-event="view_product"] .product-breadcrumb {
        display: none !important;
    }

    body[data-analytics-event="view_product"] .product-mobile-back {
        display: inline-flex !important;
        max-width: 100%;
    }

    body[data-analytics-event="view_product"] main,
    body[data-analytics-event="view_product"] section,
    body[data-analytics-event="view_product"] .mx-auto,
    body[data-analytics-event="view_product"] .grid,
    body[data-analytics-event="view_product"] .flex {
        min-width: 0;
        max-width: 100%;
    }

    body[data-analytics-event="view_product"] h1,
    body[data-analytics-event="view_product"] p,
    body[data-analytics-event="view_product"] span,
    body[data-analytics-event="view_product"] dd,
    body[data-analytics-event="view_product"] li {
        overflow-wrap: anywhere;
    }

    body[data-analytics-event="view_product"] .product-detail-hero {
        gap: 1.25rem !important;
    }

    body[data-analytics-event="view_product"] .product-detail-hero > .product-hero-media {
        order: 1;
    }

    body[data-analytics-event="view_product"] .product-detail-hero > .product-hero-copy {
        order: 2;
    }

    body[data-analytics-event="view_product"] .product-detail-hero > .product-hero-trust {
        order: 3;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        margin-top: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-main-image {
        max-height: 18rem;
        padding: 1rem !important;
    }

    body[data-analytics-event="view_product"] .product-hero-trust {
        padding: 0.9rem !important;
    }

    body[data-analytics-event="view_product"] .product-hero-trust-item {
        gap: 0.65rem !important;
        min-width: 0;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-hero-trust-icon {
        width: 2.1rem !important;
        height: 2.1rem !important;
    }

    body[data-analytics-event="view_product"] .product-hero-trust-title {
        font-size: 1rem !important;
    }

    body[data-analytics-event="view_product"] .product-hero-trust-copy {
        font-size: 0.8125rem !important;
        line-height: 1.35 !important;
    }

    body[data-analytics-event="view_product"] .product-page-title {
        font-size: 1.875rem !important;
        line-height: 1.12 !important;
        letter-spacing: 0 !important;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    body[data-analytics-event="view_product"] .product-summary-intro {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
    }

    body[data-analytics-event="view_product"] .product-summary-card {
        padding: 1rem !important;
    }

    body[data-analytics-event="view_product"] .product-purchase-summary {
        width: 100% !important;
        min-width: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-quantity-row {
        display: grid !important;
        grid-template-columns: 5rem minmax(0, 1fr) !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-quantity-input {
        width: 5rem !important;
        min-width: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-personalize-button {
        width: 100% !important;
        min-width: 0 !important;
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    body[data-analytics-event="view_product"] .product-personalize-button span:first-child {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body[data-analytics-event="view_product"] .product-buying-notes {
        display: grid !important;
        grid-template-columns: 1fr !important;
        align-items: start !important;
        gap: 0.5rem !important;
    }

    body[data-analytics-event="view_product"] .product-buying-note {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-buying-note > svg,
    body[data-analytics-event="view_product"] .product-buying-note > i {
        flex: 0 0 1rem !important;
        margin-top: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-buying-note > span {
        width: auto !important;
        min-width: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-detail-list-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        width: auto !important;
    }

    body[data-analytics-event="view_product"] .product-detail-list-row > * {
        width: auto !important;
    }

    body[data-analytics-event="view_product"] .product-info-summary {
        align-items: flex-start !important;
    }

    body[data-analytics-event="view_product"] .product-related-section {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body[data-analytics-event="view_product"] .product-related-intro h2 {
        font-size: 1.35rem !important;
        line-height: 1.2 !important;
    }

    body[data-analytics-event="view_product"] .product-related-track {
        display: grid !important;
        grid-auto-flow: column !important;
        grid-auto-columns: minmax(14.5rem, 78vw) !important;
        grid-template-columns: none !important;
        gap: 0.75rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 0.25rem;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    body[data-analytics-event="view_product"] .product-related-track > article {
        scroll-snap-align: start;
    }

    body[data-analytics-event="view_product"] .product-related-track::-webkit-scrollbar {
        display: none;
    }

    body[data-analytics-event="view_product"] .product-related-card .flex {
        flex-direction: row !important;
        align-items: center !important;
    }

    body[data-analytics-event="view_product"] .product-related-card .flex > * {
        width: auto !important;
    }
}

/* Tablet styles */

@media (min-width: 769px) and (max-width: 1024px) {
    .grid.grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .grid.grid-cols-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Touch device improvements */

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

    /* Larger touch targets */
    /* Larger touch targets — only navigation & CTA elements, not all buttons */
    nav a,
    .btn-primary,
    .btn-secondary,
    .checkout-place-order-btn,
    .homepage-cart-btn {
        min-height: 44px;
    }

    .product-breadcrumb a,
    .product-breadcrumb span {
        display: inline-flex !important;
        align-items: center;
        min-height: 0 !important;
    }

    /* Remove hover effects */
    .hover\:bg-blue-700:hover {
        background-color: inherit;
    }

    .hover\:scale-105:hover {
        transform: none;
    }
}

/* ===== CUSTOMIZER SPECIFIC MOBILE STYLES ===== */

.tool-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #6b7280;
}

.tool-tab.active {
    background: #2563eb;
    color: white;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.tool-tab:hover:not(.active) {
    background: #f3f4f6;
    transform: translateY(-1px);
}

/* Loading spinner */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Button improvements */

button,
.btn {
    transition: all 0.2s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active,
.btn:active {
    transform: translateY(0);
}

/* Smooth page transitions */

* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ===== DARK MODE SUPPORT (Optional) ===== */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ===== BRAND HARD OVERRIDE: NO BLUE TONES ===== */

:root {
    --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 22px 52px rgba(0, 0, 0, 0.2);
}

.btn-primary,
.homepage-primary-action,
.checkout-place-order-btn,
a[href="/checkout"].block.w-full,
.tool-tab.active,
.homepage-cart-btn,
.app-page #cart-btn,
.app-page button.bg-blue-600.text-white,
.app-page a.bg-blue-600.text-white,
.bg-blue-600 {
    background: #000000 !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}