/* Theme Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #171717;
    --bg-card: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(10, 10, 10, 0.95);
    --footer-bg: #000000;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(248, 250, 252, 0.95);
    --footer-bg: #f1f5f9;
}

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

/* Custom Scrollbar */

body {
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Universal theme transition */
*, *::before, *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

/* Exceptions to universal transition (e.g. icons, images, elements with their own complex transitions) */
.transition-all, .transition-colors, .transition-transform, 
ion-icon, img, .animate-fade-in-up, .reveal {
    transition: inherit !important;
}

/* ========================================
   UNIFIED RESPONSIVE NAVBAR STYLES
   Breakpoints: 376px, 768px, 1024px
   ======================================== */

/* Base Navbar Container */
.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem; /* 80px - h-20 */
    width: 100%;
}

/* Logo Styles */
.navbar-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.navbar-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Desktop Menu */
.navbar-menu {
    display: none;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2.5rem;
}

/* Right Side Icons */
.navbar-icons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Mobile Menu Button */
.navbar-mobile-btn {
    display: flex;
    margin-right: -0.5rem;
}

/* Mobile Menu Panel */
.navbar-mobile-menu {
    display: none;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.navbar-mobile-menu.active {
    display: block;
}

/* ========================================
   BREAKPOINT: 376px (Small Mobile)
   ======================================== */
@media (max-width: 376px) {
    .navbar-container {
        padding: 0 0.75rem;
        height: 4rem;
    }
    
    .navbar-logo-text {
        font-size: 1.125rem;
    }
    
    .navbar-logo ion-icon {
        font-size: 1.5rem !important;
    }
    
    .navbar-icons {
        gap: 0.25rem;
    }
    
    .navbar-icons > a,
    .navbar-icons > button {
        padding: 0.375rem;
    }
    
    .navbar-icons ion-icon {
        font-size: 1.25rem !important;
    }
    
    /* Hide non-essential icons on very small screens */
    .navbar-icons .hide-xs {
        display: none;
    }
    
    .navbar-mobile-menu .mobile-menu-content {
        padding: 0.5rem;
    }
    
    .navbar-mobile-menu a,
    .navbar-mobile-menu button {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   BREAKPOINT: 377px - 767px (Mobile/Phablet)
   ======================================== */
@media (min-width: 377px) and (max-width: 767px) {
    .navbar-container {
        padding: 0 1rem;
        height: 5rem;
    }
    
    .navbar-logo-text {
        font-size: 1.25rem;
    }
    
    .navbar-icons {
        gap: 0.5rem;
    }
    
    .navbar-mobile-menu .mobile-menu-content {
        padding: 0.5rem 0.75rem;
    }
}

/* ========================================
   BREAKPOINT: 768px - 1023px (Tablet)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .navbar-container {
        padding: 0 1.5rem;
        height: 5rem;
    }
    
    .navbar-icons {
        gap: 0.75rem;
    }
    
    /* Show condensed menu on tablets if needed */
    .navbar-menu-tablet {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .navbar-menu-tablet a {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }
    
    /* Fixed navbar height for tablets */
    nav.fixed {
        min-height: 5rem;
    }
    
    nav.fixed > div > div {
        min-height: 5rem;
    }
}

/* ========================================
   BREAKPOINT: 1024px+ (Desktop)
   ======================================== */
@media (min-width: 1024px) {
    .navbar-container {
        padding: 0 2rem;
    }
    
    .navbar-menu {
        display: flex;
    }
    
    .navbar-mobile-btn {
        display: none;
    }
    
    .navbar-mobile-menu {
        display: none !important;
    }
    
    .navbar-icons .show-desktop {
        display: flex;
    }
}

/* ========================================
   BREAKPOINT: 1024px–1279px (Tablet Landscape / Nest Hub)
   Main nav: logo + menu + icons on one row
   Dashboard nav: logo left, icons right only
   ======================================== */
@media (min-width: 1024px) and (max-width: 1279px) {

    /* Stable height for all fixed navs */
    nav.fixed {
        min-height: 4.5rem;
    }

    /* Wrapper padding */
    nav.fixed > div {
        padding-top: 0;
        padding-bottom: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Inner flex row */
    nav.fixed > div > div {
        height: 4.5rem;
        min-height: 4.5rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }

    /* ── Logo (applies to all navs) ── */
    nav.fixed > div > div > div:first-child {
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    nav.fixed > div > div > div:first-child a {
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

    nav.fixed > div > div > div:first-child .font-heading {
        font-size: 1.125rem;
        letter-spacing: 0.04em;
    }

    nav.fixed > div > div > div:first-child ion-icon {
        font-size: 1.5rem !important;
    }

    /* ── Desktop nav menu (MAIN NAV ONLY — not dashboard) ── */
    nav.fixed:not(.dashboard-nav) > div > div > div:nth-child(2) {
        display: flex !important;
        align-items: center;
        gap: 0;
        --tw-space-x-reverse: 0;
        margin-left: 0.75rem;
        margin-right: 0.75rem;
        flex: 1 1 auto;
        justify-content: center;
    }

    /* Remove Tailwind space-x margin on menu items */
    nav.fixed:not(.dashboard-nav) > div > div > div:nth-child(2) > * + * {
        margin-left: 0 !important;
    }

    /* Nav links and dropdown buttons */
    nav.fixed:not(.dashboard-nav) > div > div > div:nth-child(2) > a,
    nav.fixed:not(.dashboard-nav) > div > div > div:nth-child(2) > div > button {
        padding: 0.375rem 0.5rem;
        font-size: 0.72rem;
        letter-spacing: 0.03em;
        white-space: nowrap;
        line-height: 1;
    }

    /* ── Icons + Login + Join (MAIN NAV ONLY) ── */
    nav.fixed:not(.dashboard-nav) > div > div > div:last-child {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    nav.fixed:not(.dashboard-nav) > div > div > div:last-child ion-icon {
        font-size: 1.25rem !important;
    }

    nav.fixed:not(.dashboard-nav) > div > div > div:last-child > button {
        padding: 0.25rem 0.375rem;
    }

    nav.fixed:not(.dashboard-nav) > div > div > div:last-child > a.hidden.lg\:block:first-of-type {
        font-size: 0.72rem;
        letter-spacing: 0.03em;
        white-space: nowrap;
    }

    nav.fixed:not(.dashboard-nav) > div > div > div:last-child > a.hidden.lg\:block:last-of-type {
        font-size: 0.72rem;
        padding: 0.375rem 0.75rem;
        white-space: nowrap;
    }

    /* ── DASHBOARD NAV: Logo left, Icons right ── */
    nav.fixed.dashboard-nav > div > div {
        justify-content: space-between;
    }

    nav.fixed.dashboard-nav > div > div > div:last-child {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-shrink: 0;
        margin-left: auto;
    }

    nav.fixed.dashboard-nav > div > div > div:last-child ion-icon {
        font-size: 1.375rem !important;
    }

    nav.fixed.dashboard-nav > div > div > div:last-child button {
        padding: 0.375rem 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========================================
   HEIGHT-CONSTRAINED SCREENS (Nest Hub, etc.)
   ======================================== */
@media (min-width: 1024px) and (max-height: 700px) {
    /* Reduce navbar height on short screens but keep readable */
    nav.fixed {
        min-height: 5rem;
    }
    
    nav.fixed > div > div {
        min-height: 5rem;
        height: 5rem;
    }
    
    /* Tighter nav link spacing */
    nav.fixed [class*="hidden"][class*="lg:flex"] {
        gap: 0.625rem;
    }
    
    nav.fixed [class*="hidden"][class*="lg:flex"] > a,
    nav.fixed [class*="hidden"][class*="lg:flex"] > div > button {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }
    
    /* Smaller logo for height-constrained */
    nav.fixed .font-heading {
        font-size: 1.25rem;
    }
    
    nav.fixed .flex-shrink-0 ion-icon {
        font-size: 1.5rem !important;
    }
}

/* ========================================
   NAVBAR-HERO SEPARATION AT 1024px
   ======================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
    /* Add padding to main content after fixed navbar */
    main.pt-16,
    main.pt-20,
    section:first-of-type,
    header:first-of-type {
        margin-top: 0.5rem;
    }
    
    /* Hero sections get extra top padding */
    .hero-section,
    section[class*="pt-"] > div:first-child {
        padding-top: 1rem;
    }
}

/* ========================================
   RESPONSIVE GLASS NAVBAR FIXES
   ======================================== */
@media (max-width: 640px) {
    nav.glass {
        backdrop-filter: blur(8px);
        border-width: 0.5px;
    }
    
    .max-w-7xl, .max-w-screen-lg, .max-w-screen-md {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* Ensure consistent spacing for nav items */
.nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

/* Dropdown menu consistent styling */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 0.5rem 0;
    z-index: 50;
}

/* ========================================
   RTL/LTR SUPPORT - Comprehensive Layout
   ======================================== */

/* Base RTL class for html element */
[dir="rtl"] {
    direction: rtl;
}

/* ========================================
   NAVIGATION RTL SUPPORT - Unified Structure
   Visibility is NEVER direction-dependent
   ======================================== */

/* Navbar container - direction-aware flex */
[dir="rtl"] nav .flex.items-center.justify-between {
    flex-direction: row-reverse;
}

/* But restore inner containers to row direction */
[dir="rtl"] nav .flex.items-center.justify-between > div {
    flex-direction: row;
}

/* Navbar RTL Support */
[dir="rtl"] .navbar-menu {
    margin-left: 0;
    margin-right: 2.5rem;
}

[dir="rtl"] .navbar-mobile-btn {
    margin-right: 0;
    margin-left: -0.5rem;
}

[dir="rtl"] .nav-dropdown {
    left: auto;
    right: 0;
}

/* Mobile menu RTL - text alignment only, no visibility changes */
[dir="rtl"] #mobile-menu {
    text-align: right;
}

[dir="rtl"] #mobile-menu .text-center {
    text-align: right;
}

/* Reset justify-center to work in RTL */
[dir="rtl"] #mobile-menu .justify-center {
    justify-content: flex-end;
}

/* Ensure menu icons flip correctly */
[dir="rtl"] #mobile-menu button ion-icon[name="chevron-down-outline"] {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Desktop navigation icons/buttons gap handling */
[dir="rtl"] .flex.items-center.gap-2,
[dir="rtl"] .flex.items-center.gap-4 {
    flex-direction: row-reverse;
}

/* ========================================
   RESPONSIVE NAVIGATION RTL FIXES
   Direction-agnostic visibility rules
   ======================================== */

/* Ensure navigation visibility is ONLY controlled by breakpoints */
/* Desktop: ≥1280px - show desktop menu, hide mobile */
@media (min-width: 1024px) {
    /* These rules apply regardless of direction */
    nav .hidden.lg\:flex {
        display: flex !important;
    }
    
    nav .hidden.lg\:block {
        display: block !important;
    }
    
    nav .lg\:hidden {
        display: none !important;
    }
}

/* Mobile/Tablet: <1024px - hide desktop menu, show mobile controls */
@media (max-width: 1023px) {
    /* Show mobile menu button securely without affecting internal dropdown wrappers */
    nav .flex.lg\:hidden:not(#mobile-menu *) {
        display: flex !important;
    }
    
    /* Hide desktop menu */
    nav .hidden.lg\:flex {
        display: none !important;
    }
}

/* Mobile menu panel - toggled by JS, not by direction */
#mobile-menu.hidden {
    display: none !important;
}

#mobile-menu:not(.hidden) {
    display: block !important;
}

/* ========================================
   SIDEBAR PANEL STYLES
   Mobile/Tablet (<1024px): Off-canvas with toggle
   Desktop (≥1024px): Fixed visible sidebar
   ======================================== */

/* Base sidebar panel - hidden off-screen by default */
.sidebar-panel {
    position: fixed;
    width: 16rem; /* w-64 = 256px */
    z-index: 40;
}

/* LTR: Sidebar on left, hidden off-screen to the left */
[dir="ltr"] .sidebar-panel {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

/* RTL: Sidebar on right, hidden off-screen to the right */
[dir="rtl"] .sidebar-panel {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

/* When sidebar is open (mobile/tablet) - slide into view */
[dir="ltr"] .sidebar-panel.sidebar-open {
    transform: translateX(0);
}

[dir="rtl"] .sidebar-panel.sidebar-open {
    transform: translateX(0);
}

/* Desktop (≥1024px): Sidebar always visible */
@media (min-width: 1024px) {
    [dir="ltr"] .sidebar-panel,
    [dir="rtl"] .sidebar-panel {
        transform: translateX(0);
    }
    
    /* Content area margin for desktop */
    [dir="rtl"] .content-area {
        margin-right: 16rem; /* w-64 = 256px = 16rem */
        margin-left: 0;
    }
    
    [dir="ltr"] .content-area {
        margin-left: 16rem;
        margin-right: 0;
    }
    
    /* Footer margin for desktop */
    [dir="rtl"] footer.dashboard-footer {
        margin-right: 16rem;
        margin-left: 0;
    }
    
    [dir="ltr"] footer.dashboard-footer {
        margin-left: 16rem;
        margin-right: 0;
    }
}

/* Sidebar toggle button positioning */
[dir="rtl"] #sidebar-toggle {
    right: auto;
    left: 1.5rem;
}

[dir="ltr"] #sidebar-toggle {
    left: auto;
    right: 1.5rem;
}

/* Sidebar items RTL */
[dir="rtl"] .sidebar-item {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .sidebar-item ion-icon {
    margin-left: 0.75rem;
    margin-right: 0;
}

/* Dropdown menus RTL */
[dir="rtl"] [data-dropdown-menu] {
    left: auto;
    right: 0;
    transform-origin: top right;
}

[dir="ltr"] [data-dropdown-menu] {
    left: 0;
    right: auto;
    transform-origin: top left;
}

/* Flex reverse for RTL */
[dir="rtl"] .flex-row-rtl {
    flex-direction: row-reverse;
}

/* Text alignment */
[dir="rtl"] .text-start {
    text-align: right;
}

[dir="ltr"] .text-start {
    text-align: left;
}

[dir="rtl"] .text-end {
    text-align: left;
}

[dir="ltr"] .text-end {
    text-align: right;
}

/* Space reverse for RTL */
[dir="rtl"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

/* Card and component alignment */
[dir="rtl"] .card-content {
    text-align: right;
}

/* Timeline RTL support */
[dir="rtl"] .timeline-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .timeline-line {
    right: auto;
    left: 1.25rem;
}

/* Table RTL support */
[dir="rtl"] table {
    direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

[dir="rtl"] th:last-child,
[dir="rtl"] td:last-child {
    text-align: left;
}

/* Form inputs RTL */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
}

[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
    text-align: right;
}

/* Icons in buttons/links RTL */
[dir="rtl"] .icon-start {
    order: 1;
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .icon-end {
    order: -1;
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Badge/tag positioning RTL */
[dir="rtl"] .badge-corner {
    right: auto;
    left: 0;
}

/* Margin and padding logical properties fallback */
[dir="rtl"] .ms-auto {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .me-auto {
    margin-left: auto;
    margin-right: 0;
}

/* Stats card icon alignment */
[dir="rtl"] .stats-card {
    text-align: right;
}

[dir="rtl"] .stats-card .icon-wrapper {
    order: 1;
}

/* Wishlist and list items */
[dir="rtl"] .list-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .list-item .item-actions {
    margin-right: auto;
    margin-left: 0;
}

/* Activity timeline specific */
[dir="rtl"] .activity-timeline {
    padding-right: 1rem;
    padding-left: 0;
}

[dir="rtl"] .activity-timeline::before {
    right: 0;
    left: auto;
}

/* Cart icon badge position */
[dir="rtl"] .cart-badge {
    right: auto;
    left: 0;
}

/* Mobile menu alignment */
[dir="rtl"] #mobile-menu {
    text-align: right;
}

[dir="rtl"] #mobile-menu a,
[dir="rtl"] #mobile-menu button {
    text-align: right;
    justify-content: flex-end;
}

/* Grid and flex gap doesn't need RTL changes - works automatically */

/* Responsive RTL adjustments */
@media (max-width: 376px) {
    [dir="rtl"] .navbar-container {
        flex-direction: row-reverse;
    }
    
    [dir="rtl"] #sidebar-toggle {
        left: 1rem;
        right: auto;
    }
    
    [dir="ltr"] #sidebar-toggle {
        right: 1rem;
        left: auto;
    }
}

@media (min-width: 377px) and (max-width: 767px) {
    [dir="rtl"] #sidebar-toggle {
        left: 1.5rem;
        right: auto;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    [dir="rtl"] .content-wrapper {
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }
}

/* Chevron/arrow icons flip */
[dir="rtl"] .chevron-right {
    transform: scaleX(-1);
}

[dir="rtl"] .chevron-left {
    transform: scaleX(-1);
}

/* Progress bars RTL */
[dir="rtl"] .progress-bar {
    direction: rtl;
}

[dir="rtl"] .progress-fill {
    right: 0;
    left: auto;
}

/* Scrollbar position for RTL */
[dir="rtl"] {
    scrollbar-gutter: stable both-edges;
}

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

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

::-webkit-scrollbar-thumb {
    background: #dc2626;
    /* red-600 */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
    /* red-700 */
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.text-stroke {
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
    color: transparent;
}

.text-stroke-red {
    -webkit-text-stroke: 1px #DC2626;
    color: transparent;
}

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

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scroll Reveal classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-100 {
    transition-delay: 0.1s;
}

.reveal-delay-200 {
    transition-delay: 0.2s;
}

.reveal-delay-300 {
    transition-delay: 0.3s;
}

/* Glitch Effect (Optional Premium Touch) */
.glitch-hover:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #DC2626;
}

@keyframes glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

/* ========================================
   BRAND STRIP RESPONSIVE LAYOUT
   ======================================== */

/* Brand strip works with CSS Grid - RTL handled automatically */
.brand-strip {
    width: 100%;
}

/* Ensure proper alignment in RTL */
[dir="rtl"] .brand-strip {
    direction: rtl;
}

/* ========================================
   PAGINATION STYLES
   ======================================== */

/* Ensure pagination container is above any overlays */
#pagination {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

/* Pagination button base styles */
.pagination-btn {
    position: relative;
    z-index: 11;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

/* Ensure button content doesn't block clicks */
.pagination-btn * {
    pointer-events: none;
}

/* Active page styling */
.pagination-btn.active-page {
    background-color: #DC2626 !important;
    font-weight: 700;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* Hover state for non-active pages */
.pagination-btn.page-number:not(.active-page):hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Active/pressed state */
.pagination-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Focus visible state for keyboard navigation */
.pagination-btn:focus-visible {
    outline: 2px solid #DC2626;
    outline-offset: 2px;
}

/* Disabled state for prev/next buttons */
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* RTL support for pagination */
[dir="rtl"] #pagination {
    flex-direction: row-reverse;
}

[dir="rtl"] #prev-page ion-icon {
    transform: scaleX(-1);
}

[dir="rtl"] #next-page ion-icon {
    transform: scaleX(-1);
}

/* ========================================
   OFFER CARD IMAGE STYLES
   Consistent rendering across all breakpoints
   ======================================== */

/* Dedicated media slot - the core fix for all offer cards */
.offer-media-slot {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
}

/* Ensure media slot always has dimensions via aspect-ratio children */
.offer-media-slot > [class*="aspect-"] {
    width: 100%;
    height: 100%;
}

/* Images inside media slots must fill completely */
.offer-media-slot img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    z-index: 1;
}

/* Absolute positioned images need explicit z-index */
.offer-media-slot img.absolute {
    z-index: 1;
}

/* Badge overlays inside media slots */
.offer-media-slot > span,
.offer-media-slot > div:not([class*="aspect-"]) {
    z-index: 10;
}

/* Prevent layout shift - reserve space before image loads */
.offer-media-slot [class*="aspect-"] {
    background-color: var(--bg-secondary);
}

/* Main offer cards - side-by-side layout */
.flex-col.sm\:flex-row > .offer-media-slot {
    min-height: 200px;
}

@media (min-width: 640px) {
    .flex-col.sm\:flex-row > .offer-media-slot {
        min-height: auto;
    }
    
    .flex-col.sm\:flex-row > .offer-media-slot > .aspect-\[4\/3\] {
        height: 100%;
        min-height: 260px;
    }
}

/* Clearance grid cards - square aspect */
.grid-cols-2 .offer-media-slot,
.md\:grid-cols-4 .offer-media-slot {
    border-radius: 0.5rem;
}

/* Bundle cards in horizontal scroll */
.snap-x .offer-media-slot {
    border-radius: 0;
}

/* RTL support for offer cards */
[dir="rtl"] .flex-col.sm\:flex-row {
    flex-direction: column;
}

@media (min-width: 640px) {
    [dir="rtl"] .flex-col.sm\:flex-row {
        flex-direction: row-reverse;
    }
}

/* Ensure hover effects don't cause layout shift */
.group:hover .offer-media-slot img {
    transform-origin: center center;
}

/* Prevent image distortion on transform */
.offer-media-slot img.group-hover\:scale-105 {
    will-change: transform;
}

/* Responsive breakpoint fixes */
@media (max-width: 375px) {
    .offer-media-slot {
        min-height: 160px;
    }
}

@media (min-width: 376px) and (max-width: 767px) {
    .offer-media-slot {
        min-height: 180px;
    }
    
    .grid-cols-2 .offer-media-slot {
        min-height: auto;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .flex-col.sm\:flex-row > .offer-media-slot {
        min-height: auto;
    }
}

@media (min-width: 1024px) {
    .flex-col.sm\:flex-row > .offer-media-slot > .aspect-\[4\/3\] {
        min-height: 280px;
    }
}

/* ========================================
   LOGIN / SIGNUP PAGE — LIGHT MODE FIXES
   ======================================== */

/* Toggle button hover: white/5 is invisible in light mode */
[data-theme="light"] #theme-toggle:hover,
[data-theme="light"] #rtl-toggle:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* Image panel overlay gradient — always needs to be dark so text stays readable */
/* The gradient is fine as-is; ensure text on image panel is always white */
.auth-image-panel .auth-panel-text {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Right (form) panel background — use theme variable */
[data-theme="light"] .auth-form-panel {
    background-color: var(--bg-primary);
}

/* Form input border lines in light mode */
[data-theme="light"] .auth-form-panel input {
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}

/* Social buttons in light mode */
[data-theme="light"] .auth-form-panel .social-btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="light"] .auth-form-panel .social-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background-color: transparent;
}

/* Divider line in light mode */
[data-theme="light"] .auth-divider-line {
    background-color: var(--border-color);
}