@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom dropdown animations and styles */
.dropdown-menu {
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dropdown-item {
    position: relative;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--brand);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

/* Mobile menu animations */
.mobile-menu-item {
    transform: translateX(-10px);
    opacity: 0;
    animation: slideInLeft 0.3s ease forwards;
}

.mobile-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-item:nth-child(2) { animation-delay: 0.2s; }
.mobile-menu-item:nth-child(3) { animation-delay: 0.3s; }
.mobile-menu-item:nth-child(4) { animation-delay: 0.4s; }
.mobile-menu-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Flag icon styles */
.flag-icon {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* International Phone Input Styling */
.react-international-phone-input-container {
    display: flex !important;
    width: 100% !important;
}

.react-international-phone-input-container input {
    border: 1px solid hsl(20, 5.9%, 90%) !important;
    border-radius: 0 6px 6px 0 !important;
    border-left: none !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    transition: border-color 0.2s ease !important;
    background: hsl(0, 0%, 100%) !important;
    color: hsl(20, 14.3%, 4.1%) !important;
}

.react-international-phone-input-container input:focus {
    outline: none !important;
    border-color: hsl(20, 82%, 55%) !important;
    box-shadow: 0 0 0 2px hsl(20, 82%, 55%, 0.2) !important;
}

.react-international-phone-country-selector-button {
    background: hsl(0, 0%, 100%) !important;
    border: 1px solid hsl(20, 5.9%, 90%) !important;
    border-radius: 6px 0 0 6px !important;
    border-right: none !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    min-width: 60px !important;
}

.react-international-phone-country-selector-button:hover {
    background: hsl(60, 4.8%, 95.9%) !important;
}

.react-international-phone-country-selector-dropdown {
    border: 1px solid hsl(20, 5.9%, 90%) !important;
    border-radius: 6px !important;
    background: hsl(0, 0%, 100%) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    z-index: 50 !important;
}

.react-international-phone-country-selector-dropdown__list-item {
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: hsl(20, 14.3%, 4.1%) !important;
    cursor: pointer !important;
}

.react-international-phone-country-selector-dropdown__list-item:hover {
    background: hsl(60, 4.8%, 95.9%) !important;
}

/* Dark mode styles for phone input */
.dark .react-international-phone-input-container input {
    background: hsl(20, 14.3%, 4.1%) !important;
    border-color: hsl(20, 5.9%, 20%) !important;
    color: hsl(0, 0%, 98%) !important;
}

.dark .react-international-phone-country-selector-button {
    background: hsl(20, 14.3%, 4.1%) !important;
    border-color: hsl(20, 5.9%, 20%) !important;
    color: hsl(0, 0%, 98%) !important;
}

.dark .react-international-phone-country-selector-dropdown {
    background: hsl(20, 14.3%, 4.1%) !important;
    border-color: hsl(20, 5.9%, 20%) !important;
}

.dark .react-international-phone-country-selector-dropdown__list-item {
    color: hsl(0, 0%, 98%) !important;
}

.dark .react-international-phone-country-selector-dropdown__list-item:hover {
    background: hsl(20, 5.9%, 20%) !important;
}

:root {
    --font-sans: 'Manrope', ui-sans-serif, system-ui, sans-serif;
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(20, 14.3%, 4.1%);
    --muted: hsl(60, 4.8%, 95.9%);
    --muted-foreground: hsl(25, 5.3%, 44.7%);
    --popover: hsl(0, 0%, 100%);
    --popover-foreground: hsl(20, 14.3%, 4.1%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(20, 14.3%, 4.1%);
    --border: hsl(20, 5.9%, 90%);
    --input: hsl(20, 5.9%, 90%);
    --primary: hsl(0, 71%, 47%);
    --primary-foreground: hsl(0, 0%, 98%);
    --secondary: hsl(60, 4.8%, 95.9%);
    --secondary-foreground: hsl(24, 9.8%, 10%);
    --accent: hsl(60, 4.8%, 95.9%);
    --accent-foreground: hsl(24, 9.8%, 10%);
    --destructive: hsl(0, 84.2%, 60.2%);
    --destructive-foreground: hsl(60, 9.1%, 97.8%);
    --ring: hsl(20, 14.3%, 4.1%);
    --radius: 0.5rem;

    /* Brand colors */
    --brand: hsl(0, 71%, 47%);
    --brand-dark: hsl(0, 71%, 37%);
    --brand-light: hsl(0, 71%, 57%);
}

.dark {
    --background: hsl(240, 10%, 3.9%);
    --foreground: hsl(0, 0%, 98%);
    --muted: hsl(240, 3.7%, 15.9%);
    --muted-foreground: hsl(240, 5%, 64.9%);
    --popover: hsl(240, 10%, 3.9%);
    --popover-foreground: hsl(0, 0%, 98%);
    --card: hsl(240, 10%, 3.9%);
    --card-foreground: hsl(0, 0%, 98%);
    --border: hsl(240, 3.7%, 15.9%);
    --input: hsl(240, 3.7%, 15.9%);
    --primary: hsl(0, 71%, 47%);
    --primary-foreground: hsl(0, 0%, 98%);
    --secondary: hsl(240, 3.7%, 15.9%);
    --secondary-foreground: hsl(0, 0%, 98%);
    --accent: hsl(240, 3.7%, 15.9%);
    --accent-foreground: hsl(0, 0%, 98%);
    --destructive: hsl(0, 62.8%, 30.6%);
    --destructive-foreground: hsl(0, 0%, 98%);
    --ring: hsl(240, 4.9%, 83.9%);
}

@layer base {
    * {
        @apply border-border;
    }

    body {
        @apply font-sans antialiased bg-background text-foreground;
        font-family: var(--font-sans);
    }

    html {
        scroll-behavior: smooth;
    }
}

@layer components {
    .brand-text {
        color: var(--brand);
    }

    .brand-bg {
        background-color: var(--brand);
    }

    .brand-border {
        border-color: var(--brand);
    }

    .tab-btn.active {
        background-color: var(--brand);
        color: white;
    }

    .hero-gradient {
        background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    }

    /* Content Pages Styling */
    .content-page {
        @apply text-gray-800 leading-relaxed;
    }

    .content-page h2 {
        @apply text-2xl font-bold text-gray-900 mb-6 mt-8 first:mt-0 border-b border-gray-200 pb-3;
        color: var(--brand);
    }

    .content-page h3 {
        @apply text-xl font-semibold text-gray-800 mb-4 mt-6;
    }

    .content-page h4 {
        @apply text-lg font-medium text-gray-800 mb-3 mt-4;
    }

    .content-page p {
        @apply mb-4 text-gray-700 leading-7;
    }

    .content-page ul {
        @apply mb-6 space-y-2 pl-6;
    }

    .content-page ol {
        @apply mb-6 space-y-2 pl-6;
    }

    .content-page li {
        @apply text-gray-700 leading-6 relative;
    }

    .content-page ul li {
        @apply relative pl-2;
    }

    .content-page ul li::before {
        @apply absolute left-0 top-2 w-1 h-1 bg-brand rounded-full;
        content: '';
        margin-left: -1rem;
    }

    .content-page ol li {
        @apply relative;
    }

    .content-page a {
        @apply text-brand hover:text-brand-dark underline transition-colors;
    }

    .content-page strong {
        @apply font-semibold text-gray-900;
    }

    .content-page em {
        @apply italic text-gray-600;
    }

    .content-page blockquote {
        @apply border-l-4 border-brand pl-4 italic text-gray-600 my-6;
    }

    .content-page code {
        @apply bg-gray-100 px-2 py-1 rounded text-sm font-mono text-gray-800;
    }

    .content-page pre {
        @apply bg-gray-100 p-4 rounded-lg overflow-x-auto my-6;
    }

    .content-page pre code {
        @apply bg-transparent p-0;
    }

    .content-page table {
        @apply w-full border-collapse border border-gray-300 my-6;
    }

    .content-page th, .content-page td {
        @apply border border-gray-300 px-4 py-2 text-left;
    }

    .content-page th {
        @apply bg-gray-50 font-semibold;
    }

    /* Dark mode content pages */
    .dark .content-page {
        @apply text-gray-200;
    }

    .dark .content-page h2 {
        @apply text-gray-100 border-gray-700;
    }

    .dark .content-page h3,
    .dark .content-page h4 {
        @apply text-gray-200;
    }

    .dark .content-page p,
    .dark .content-page li {
        @apply text-gray-300;
    }

    .dark .content-page strong {
        @apply text-gray-100;
    }

    .dark .content-page em {
        @apply text-gray-400;
    }

    .dark .content-page blockquote {
        @apply text-gray-400;
    }

    .dark .content-page code {
        @apply bg-gray-800 text-gray-200;
    }

    .dark .content-page pre {
        @apply bg-gray-800;
    }

    .dark .content-page th {
        @apply bg-gray-800;
    }

    .dark .content-page th,
    .dark .content-page td {
        @apply border-gray-600;
    }
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

[data-reveal] {
    opacity: 1;
    transform: translateY(0);
}

.reveal-ready[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
    will-change: transform, opacity;
}

.reveal-ready[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .mobile-menu-overlay {
        backdrop-filter: blur(4px);
    }

    .mobile-cta-dock {
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-ready[data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Focus styles for accessibility */
.focus-ring {
    @apply focus:outline-none focus:ring-2 focus:ring-[var(--brand)] focus:ring-offset-2;
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Hide scrollbar for webkit browsers */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

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



.prose {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.75;
    max-width: 100%;
}

.prose h1 {
    font-weight: 700;
    font-size: 2.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #111827;
}

.prose h2 {
    font-weight: 600;
    font-size: 1.875rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 0.3em;
    color: #111827;
}

.prose h3 {
    font-weight: 600;
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose h4 {
    font-weight: 500;
    font-size: 1.25rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.prose h5 {
    font-weight: 500;
    font-size: 1.125rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.prose h6 {
    font-weight: 500;
    font-size: 1rem;
    text-transform: uppercase;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.prose p {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.prose u {
    text-decoration: underline;
    text-decoration-color: #cd2323;
    text-underline-offset: 2px;
}

.prose s {
    text-decoration: line-through;
    color: #cd2323;
}

.prose a {
    color: #cd2323;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    font-weight: 500;
}

.prose a:hover {
    color: #a11b1b;
}

.prose strong {
    font-weight: 700;
    color: #cd2323;
}

.prose em {
    font-style: italic;
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose ul > li::marker,
.prose ol > li::marker {
    color: #cd2323;
}

.prose blockquote {
    font-style: italic;
    border-left: 4px solid #cd2323;
    padding-left: 1rem;
    color: #4b5563;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.prose code {
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.95em;
    font-weight: 500;
}

.prose pre {
    background-color: #111827;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.prose img {
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    max-width: 100%;
    height: auto;
}

.prose figure {
    margin-top: 2em;
    margin-bottom: 2em;
    text-align: center;
}

.prose figcaption {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.prose video {
    border-radius: 0.5rem;
    max-width: 100%;
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: block;
}

.prose hr {
    border-top: 1px solid #d1d5db;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.prose thead th {
    border-bottom: 2px solid #d1d5db;
    text-align: left;
    padding: 0.5rem;
    font-weight: 600;
}

.prose tbody td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem;
}




@media print {
    body * {
        visibility: hidden !important;
    }

    [data-print-area],
    [data-print-area] * {
        visibility: visible !important;
    }

    [data-print-area] {
        position: absolute !important;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }
}


.swiper {
    padding-bottom: 48px;
}
.custom-slider-nav .swiper-button-next,
.custom-slider-nav .swiper-button-prev {
    background-color: #ffffff;
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    color: var(--brand);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-slider-nav .swiper-button-next::after,
.custom-slider-nav .swiper-button-prev::after {
    content: none;
}
.custom-slider-nav .swiper-button-lock{
    display: none !important;
}


.swiper-pagination-bullet {
    background: var(--brand, #000);
    opacity: 0.4;
}
.swiper-pagination-bullet-active {
    background: var(--brand, #000);
    opacity: 1;
}
.lucide-chevron-left,
.lucide-chevron-right {
    display: block;
}

.review-card-carousel .swiper-wrapper {
    align-items: stretch;
}

.review-card-carousel .swiper-slide {
    height: auto;
}

.review-card-modern {
    padding-bottom: 0.25rem;
}

.review-card-modern[data-review-source="google"] {
    --review-accent: #4285f4;
}

.review-card-modern[data-review-source="yandex"] {
    --review-accent: #fc3f1d;
}

.review-card-modern[data-review-source="tripadvisor"] {
    --review-accent: #00aa6c;
}

.review-comment-bubble {
    position: relative;
    transition: box-shadow 0.25s ease;
}

.review-comment-bubble::after {
    content: "";
    position: absolute;
    left: 1.1rem;
    bottom: -0.46rem;
    width: 0.9rem;
    height: 0.9rem;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(-45deg);
}

.review-card-modern:hover .review-comment-bubble {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.review-card-modern__read-more {
    color: var(--brand);
}

.review-card-modern__read-more:hover {
    color: var(--brand-dark);
}

.review-rating-pill {
    display: inline-flex;
    align-items: flex-end;
    line-height: 1;
    color: #0f172a;
}

.review-rating-pill__whole {
    font-size: 1.15rem;
    font-weight: 800;
}

.review-rating-pill__fraction {
    font-size: 0.78rem;
    font-weight: 700;
    transform: translateY(-1px);
}

.review-read-modal {
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-read-modal__panel {
    z-index: 1;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.review-read-modal__comment {
    font-size: clamp(1.25rem, 1.85vw, 2rem);
}

.review-read-modal [data-review-modal-source] .review-source-logo__yandex {
    color: #f8fafc;
}

.review-read-modal [data-review-modal-source] .review-source-logo__tripadvisor {
    color: #7ce8bf;
}

.review-inline-brand-wrap {
    display: flex;
    justify-content: flex-end;
}

.review-inline-brand-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    width: min(100%, 860px);
}

.review-inline-brand-card {
    display: block;
    border-radius: 0.9rem;
    border: 1px solid #1f2937;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 0.9rem 1rem;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.review-inline-brand-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.3);
}

.review-inline-brand-card__score {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    color: #f8fafc;
}

.review-inline-brand-card__score small {
    font-size: 1.05rem;
    font-weight: 700;
    margin-left: 1px;
    opacity: 0.95;
}

.review-inline-brand-card__stars {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    margin-bottom: 0.15rem;
}

.review-source-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.review-source-logo__google {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.review-source-logo__google .g-blue {
    color: #4285f4;
}

.review-source-logo__google .g-red {
    color: #ea4335;
}

.review-source-logo__google .g-yellow {
    color: #fbbc05;
}

.review-source-logo__google .g-green {
    color: #34a853;
}

.review-source-logo__yandex {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.review-source-logo__yandex .y-red {
    color: #fc3f1d;
}

.review-source-logo__tripadvisor {
    font-size: 0.95rem;
    font-weight: 700;
    color: #00aa6c;
}

.review-source-logo__yandex--dark {
    color: #e2e8f0;
}

.review-source-logo__tripadvisor--dark {
    color: #7ce8bf;
}

@media (max-width: 640px) {
    .review-comment-bubble::after {
        left: 0.95rem;
    }

    .review-inline-brand-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .review-inline-brand-wrap {
        justify-content: flex-start;
    }

    .review-inline-brand-card__score {
        font-size: 2.05rem;
    }

    .review-inline-brand-card__score small {
        font-size: 0.95rem;
    }

    .review-rating-pill__whole {
        font-size: 1.05rem;
    }

    .review-rating-pill__fraction {
        font-size: 0.72rem;
    }

    .review-source-logo__google {
        font-size: 0.92rem;
    }

    .review-read-modal__comment {
        font-size: clamp(1.05rem, 3.9vw, 1.35rem);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .review-inline-brand-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

input[type="checkbox"]:checked {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

input[type="checkbox"]::before {
    content: '';
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" class="h-4 w-4"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
    background-size: contain;
}

input[type="checkbox"]:checked::before {
    display: block;
}

.top-marquee {
    overflow: hidden;
}

.top-marquee-track {
    display: flex;
    width: max-content;
    align-items: center;
    animation: top-marquee-scroll 22s linear infinite;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.top-marquee-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.58rem 4rem 0.58rem 0;
    flex-shrink: 0;
}

.top-marquee-item {
    position: relative;
    display: inline-block;
    color: #9f1239;
    font-size: 0.93rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    flex-shrink: 0;
    white-space: nowrap;
}

.top-marquee-item:not(:last-child)::after {
    content: "|";
    margin-left: 1.25rem;
    color: #b91c1c;
    opacity: 0.75;
}

@keyframes top-marquee-scroll {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

@media (max-width: 768px) {
    .top-marquee-group {
        gap: 1rem;
        padding: 0.48rem 3rem 0.48rem 0;
    }

    .top-marquee-item {
        font-size: 0.82rem;
    }

    .top-marquee-item:not(:last-child)::after {
        margin-left: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .top-marquee-track {
        animation: none;
    }
}

.why-flip-card {
    position: relative;
    min-height: 220px;
    perspective: 1200px;
    transform-style: preserve-3d;
    overflow: hidden;
    isolation: isolate;
}

.why-flip-card > * {
    backface-visibility: hidden;
    transform-origin: center center;
    transition:
        transform 0.78s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.78s cubic-bezier(0.22, 1, 0.36, 1);
}

.why-flip-card::after {
    content: attr(data-why-back);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(145deg, #0f172a, #1e293b);
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    transform: rotateY(-180deg) scale(0.985);
    transition:
        transform 0.82s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.82s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.28);
    backface-visibility: hidden;
}

.why-flip-card.is-touch-active > * {
    opacity: 0;
    transform: rotateY(180deg) scale(0.985);
}

.why-flip-card.is-touch-active::after {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
}

@media (min-width: 1024px) {
    .why-flip-card:hover > *,
    .why-flip-card:focus-within > * {
        opacity: 0;
        transform: rotateY(180deg) scale(0.985);
    }

    .why-flip-card:hover::after,
    .why-flip-card:focus-within::after {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
    }
}

@media (hover: none), (pointer: coarse) {
    .touch-hover-card {
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    .touch-hover-card.is-touch-active {
        transform: translateY(-4px);
        box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
    }
}
