:root {
    --vh: 1vh;
    --header-height: 64px;
    --header-height-lg: 80px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-top: env(safe-area-inset-top, 0px);
}

@media (min-width: 1024px) {
    :root {
        --header-height: 80px;
    }
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

::selection {
    background-color: #1e40af;
    color: white;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.h-screen-mobile {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

*:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

.touch-device button,
.touch-device a {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

@media (max-width: 640px) {
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@-webkit-keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-primary {
    background-color: #1e40af;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #1e3a8a;
}

.btn-primary:active {
    background-color: #172554;
}

.btn-accent {
    background-color: #ea580c;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-accent:hover {
    background-color: #c2410c;
}

.btn-accent:active {
    background-color: #9a3412;
}

.btn-outline {
    background-color: transparent;
    color: #1e40af;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid #1e40af;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: #1e40af;
    color: white;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    border-color: #1e40af;
    outline: none;
}

.input-field::placeholder {
    color: #94a3b8;
}

.input-label {
    display: block;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.card-premium {
    background: white;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease;
}

.card-premium:hover {
    border-color: #1e40af;
}

header.scrolled {
    border-bottom: 1px solid #e2e8f0;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table tr {
    border-bottom: 1px solid #e2e8f0;
}

.spec-table tr:last-child {
    border-bottom: none;
}

.spec-table td {
    padding: 0.75rem 1rem;
}

@media (max-width: 640px) {
    .spec-table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

.spec-table td:first-child {
    color: #64748b;
    font-weight: 500;
}

.spec-table td:last-child {
    color: #1e293b;
    font-weight: 600;
    text-align: right;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-accent {
    background: #ffedd5;
    color: #c2410c;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.input-error {
    border-color: #dc2626 !important;
}

.input-success {
    border-color: #16a34a !important;
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#mobile-menu,
#search-modal,
#cart-sidebar {
    touch-action: none;
}

#mobile-menu.open #mobile-panel {
    transform: translateX(0);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    #mobile-panel>div:last-child {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }

    #search-modal>div>div:last-child {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

.whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
}

@media (max-width: 640px) {
    .whatsapp-float {
        bottom: 1rem;
        right: 1rem;
    }
}

.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

@media (min-width: 640px) {
    .product-grid {
        gap: 1.5rem;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    h3 {
        font-size: 1.25rem;
    }

    p {
        font-size: 0.9375rem;
    }
}

@media (max-width: 640px) {
    .section-padding {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .container-mobile {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.img-container {
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.img-container img {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #dbeafe;
    color: #1e40af;
    font-size: 1.25rem;
}

@media (max-width: 640px) {
    .feature-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

.section-divider {
    height: 1px;
    background-color: #e2e8f0;
}

@media print {

    header,
    footer,
    .cart-sidebar,
    .whatsapp-float,
    .no-print,
    #mobile-menu {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

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

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

    html {
        scroll-behavior: auto;
    }
}

@supports not (backdrop-filter: blur(12px)) {

    .backdrop-blur-sm,
    .backdrop-blur-md,
    .backdrop-blur-lg {
        background-color: rgba(255, 255, 255, 0.98);
    }
}

@supports (-webkit-touch-callout: none) {
    .sticky {
        position: -webkit-sticky;
    }

    /* Fix for iOS safari 100vh issue */
    .full-height-ios {
        min-height: -webkit-fill-available;
    }
}


@media (max-width: 640px) {
    .product-card-mobile .card-content {
        padding: 0.75rem;
    }

    .product-card-mobile .card-title {
        font-size: 0.875rem;
    }

    .product-card-mobile .card-description {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #0f172a;
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    margin-bottom: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
    .tooltip:hover::after {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 640px) {
    #cart-panel {
        max-width: 100% !important;
    }
}


@media (max-width: 640px) {
    .hero-mobile {
        min-height: calc(100vh - var(--header-height));
        min-height: calc((var(--vh, 1vh) * 100) - var(--header-height));
    }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}


.nav-active {
    position: relative;
}

.nav-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1e40af;
}


#desktop-search-modal {
    transition: opacity 0.2s ease;
}

#desktop-search-container {
    transition: transform 0.2s ease;
}

#desktop-search-input::placeholder {
    color: #94a3b8;
}

[data-search-item]:hover,
[data-search-item].bg-slate-100 {
    background-color: #f8fafc;
}

kbd {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    border-radius: 3px;
}

mark {
    background-color: #fef08a;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 2px;
}

@supports not (backdrop-filter: blur(4px)) {
    #desktop-search-modal>div:first-child {
        background-color: rgba(15, 23, 42, 0.85);
    }
}


.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .safe-area-bottom {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

nav.fixed.bottom-0 button:active,
nav.fixed.bottom-0 a:active {
    opacity: 0.7;
}