/* ========================================
   APPMART - Clean White E-Commerce Theme
   Inspired by TTGShop.vn
   ======================================== */

/* ========================================
   CSS Variables (Design Tokens)
   ======================================== */

:root {
    /* Brand Colors — Vibrant Red-Orange accent (like TTGShop) */
    --color-primary: #E53E3E;
    --color-primary-hover: #C53030;
    --color-primary-light: #FFF5F5;
    --color-primary-dark: #9B2C2C;

    /* Legacy aliases so existing Blade references to --color-gold still work */
    --color-gold: var(--color-primary);
    --color-gold-hover: var(--color-primary-hover);
    --color-gold-light: var(--color-primary-light);
    --color-gold-dark: var(--color-primary-dark);

    /* Background — Clean White */
    --background: #FFFFFF;
    --background-secondary: #F7F8FA;
    --background-card: #FFFFFF;
    --background-card-hover: #F9FAFB;
    --background-elevated: #F1F3F5;

    /* Foreground / Text */
    --foreground: #1A1A2E;
    --foreground-secondary: #6B7280;
    --foreground-muted: #9CA3AF;

    /* Borders */
    --border: #E5E7EB;
    --border-hover: #D1D5DB;
    --border-accent: var(--color-primary);

    /* Status */
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* Shadows — light mode */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-gold: 0 0 20px rgba(229, 62, 62, 0.12);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    /* Transition */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ========================================
   Base Styles
   ======================================== */

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* No bottom-nav on mobile — sidebar menu replaces it */
@media (max-width: 767px) {
    body {
        padding-bottom: 0;
    }
}

/* ========================================
   Section Frame — Mobile Responsive
   ======================================== */
@media (max-width: 639px) {
    .section-frame-header {
        flex-wrap: wrap;
    }

    /* Title — full row on mobile */
    .section-frame-title {
        width: 100%;
        clip-path: none;
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Tabs row — scroll ngang bên dưới title */
    .section-frame-tabs {
        flex: 1;
        min-width: 0;
        padding: 4px 8px;
        overflow-x: auto;
    }

    /* Viewall — nằm cùng hàng với tabs trên mobile */
    .section-frame-viewall {
        margin-left: 0;
        padding: 4px 10px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .section-frame-body {
        padding: 10px;
    }
}

/* Selection */
::selection {
    background-color: rgba(229, 62, 62, 0.15);
    color: var(--foreground);
}

/* Scrollbar — light */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ========================================
   Typography
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--foreground);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ========================================
   Utility Classes
   ======================================== */

.container-luxe {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Primary Button (replaces btn-gold) */
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background-color: var(--color-primary);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.25);
}

.btn-gold:hover {
    background-color: var(--color-primary-hover);
    box-shadow: 0 4px 16px rgba(229, 62, 62, 0.35);
    transform: translateY(-1px);
}

/* Outline Button */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background-color: transparent;
    color: var(--foreground);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: var(--color-primary-light);
}

/* Small button variant */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Card */
.card-luxe {
    background-color: var(--background-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-card);
}

.card-luxe:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

/* Input */
.input-luxe {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--background-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--foreground);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-luxe::placeholder {
    color: var(--foreground-muted);
}

.input-luxe:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Badge */
.badge-gold {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-primary);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    border: none;
}

.badge-success {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.badge-error {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.badge-warning {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

/* Section spacing */
.section-spacing {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

/* Divider */
.divider {
    height: 1px;
    background-color: var(--border);
    margin: 2rem 0;
}

/* Gold text → Primary text */
.text-gold {
    color: var(--color-primary);
}

/* Gold gradient text → Primary gradient */
.text-gold-gradient {
    background: linear-gradient(135deg, var(--color-primary), #F56565);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Price text */
.price-text {
    color: var(--color-primary);
    font-weight: 700;
}

/* ========================================
   Product Card Hover Popup Dialog
   ======================================== */

.product-card-wrapper {
    position: relative;
    overflow: visible;
}

/* Hide popup on mobile (touch devices don't hover well) */
@media (max-width: 767px) {
    .product-card-wrapper [x-show="showPopup"] {
        display: none !important;
    }
}

/* ========================================
   Section with TTGShop-style frame
   ======================================== */

.section-category {
    position: relative;
    /* NO overflow:hidden — popup needs to overflow */
}

.section-frame {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: visible;
}

.section-frame-header {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid #f3f4f6;
    padding: 0;
    min-height: 48px;
    flex-wrap: wrap;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden;
}

.section-frame-title {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    padding: 0 20px;
    background: var(--color-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 100%, 0% 100%);
    padding-right: 32px;
}

.section-frame-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 8px;
}

.section-frame-tabs::-webkit-scrollbar {
    display: none;
}

.section-frame-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 20px;
    margin: 6px 2px;
    transition: all 0.2s ease;
}

.section-frame-tab:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.section-frame-tab.active {
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(229, 62, 62, 0.25);
}

.section-frame-viewall {
    margin-left: auto;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
}

.section-frame-viewall:hover {
    gap: 8px;
}

.section-frame-body {
    padding: 16px;
}

/* Color variants for section titles */
.section-frame-title-0 { background: var(--color-primary); }
.section-frame-title-1 { background: #2563eb; }
.section-frame-title-2 { background: #059669; }
.section-frame-title-3 { background: #d97706; }

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse-gold {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.3);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(229, 62, 62, 0);
    }
}

@keyframes collectFly {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    60% {
        opacity: 1;
        transform: translateY(-40px);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px);
    }
}

@keyframes dialogIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

@keyframes floating-wiggle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    15% {
        transform: translateY(-3px) rotate(-5deg);
    }

    30% {
        transform: translateY(-5px) rotate(5deg);
    }

    45% {
        transform: translateY(-3px) rotate(-3deg);
    }

    60% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes floating-glow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 0 0 0 0 var(--glow-color, #0068FF);
    }

    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 0 18px 3px var(--glow-color, #0068FF);
    }
}

.animate-collect-fly {
    animation: collectFly 1.2s ease-out forwards;
}

/* Direct animation classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

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

.animate-fade-in-down {
    animation: fadeInDown 0.5s ease forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

/* Stagger delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

/* Scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.slide-left {
    transform: translateX(-40px);
}

.animate-on-scroll.slide-left.is-visible {
    transform: translateX(0);
}

.animate-on-scroll.slide-right {
    transform: translateX(40px);
}

.animate-on-scroll.slide-right.is-visible {
    transform: translateX(0);
}

.animate-on-scroll.scale {
    transform: scale(0.9);
}

.animate-on-scroll.scale.is-visible {
    transform: scale(1);
}

/* Hover micro-interactions */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.hover-glow:hover {
    box-shadow: var(--shadow-gold);
}

/* Image hover zoom */
.img-zoom {
    overflow: hidden;
}

.img-zoom img,
.img-zoom .img-inner {
    transition: transform 0.7s ease;
}

.img-zoom:hover img,
.img-zoom:hover .img-inner {
    transform: scale(1.05);
}

/* Star rating */
.star-filled {
    color: #F59E0B;
}

.star-empty {
    color: var(--foreground-muted);
}

/* Skeleton loading shimmer */
.skeleton {
    background: linear-gradient(90deg, var(--background-secondary) 25%, var(--background-elevated) 50%, var(--background-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Hide scrollbar for horizontal scroll */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

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

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

/* ========================================
   Prose styles for backend HTML content
   ======================================== */

.prose {
    line-height: 1.75;
    font-size: 1rem;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

.prose h1 {
    font-size: 2em;
}

.prose h2 {
    font-size: 1.5em;
}

.prose h3 {
    font-size: 1.25em;
}

.prose h4 {
    font-size: 1.1em;
}

.prose p {
    margin-bottom: 1em;
}

.prose a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    opacity: 0.8;
}

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

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    margin-bottom: 0.5em;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1em 0;
}

.prose blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    color: var(--foreground-secondary);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.prose th,
.prose td {
    padding: 0.75em 1em;
    border: 1px solid var(--border);
    text-align: left;
}

.prose th {
    background: var(--background-elevated);
    font-weight: 600;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

.prose-invert {
    color: var(--foreground-secondary);
}

.prose-invert h1,
.prose-invert h2,
.prose-invert h3,
.prose-invert h4,
.prose-invert h5,
.prose-invert h6 {
    color: var(--foreground);
}

.prose strong,
.prose b {
    font-weight: 700;
}

/* ========================================
   Floating contact animations
   ======================================== */

.floating-item:nth-child(1) .floating-icon-circle {
    animation: floating-wiggle 4s ease-in-out infinite, floating-glow 3s ease-in-out infinite;
    --glow-color: #0068FF;
}

.floating-item:nth-child(2) .floating-icon-circle {
    animation: floating-wiggle 4s ease-in-out 0.5s infinite, floating-glow 3s ease-in-out 0.5s infinite;
    --glow-color: #1877F2;
}

.floating-item:nth-child(3) .floating-icon-circle {
    animation: floating-wiggle 4s ease-in-out 1s infinite, floating-glow 3s ease-in-out 1s infinite;
    --glow-color: #22C55E;
}

.floating-item:nth-child(4) .floating-icon-circle {
    animation: floating-wiggle 4s ease-in-out 1.5s infinite, floating-glow 3s ease-in-out 1.5s infinite;
    --glow-color: #F59E0B;
}

.floating-icon-circle:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
}