/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Primary Colors */
    --primary-color: #010F1C;
    --primary-dark: #0a0f1a;
    --primary-light: #1a2532;
    --primary-rgb: 1, 15, 28;

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;

    /* Border Colors */
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;

    /* Status Colors */
    --success: #10B981;
    --success-rgb: 16, 185, 129;
    --error: #EF4444;
    --error-rgb: 239, 68, 68;
    --warning: #F59E0B;
    --warning-rgb: 245, 158, 11;
    --info: #3B82F6;

    /* Scrollbar Colors */
    --scrollbar-track: #444444;
    --scrollbar-thumb: #000000;
    --scrollbar-thumb-hover: #000000;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Header Icons - Default Color */
.theme-header-icon {
    color: var(--primary-color, #3B82F6);
}

/* Search Form */
.theme-search-form {
    border-color: var(--primary-color, #3B82F6);
}

.theme-search-icon {
    color: var(--primary-color, #3B82F6);
}

.theme-search-btn {
    background: var(--primary-color, #3B82F6);
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
    border: 3px solid var(--scrollbar-track);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ========================================
   Header
   ======================================== */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-panel {
    height: auto;
    background: #FFFFFF;
}

/* ========================================
   Mega Menu
   ======================================== */

.mega-side-item.active {
    background: #ffffff;
    color: #010F1C;
    border-left-color: #010F1C;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

[dir="rtl"] .mega-side-item.active {
    border-left-color: transparent;
    border-right-color: #010F1C;
}

.mega-side-item.active i {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

[dir="rtl"] .mega-side-item.active i {
    transform: translateX(0) rotate(180deg) !important;
}

.mega-content-box.active {
    display: block !important;
}

/* Mobile bottom nav - show on mobile */
@media (max-width: 1023px) {
    #mobileBottomNav {
        display: block !important;
    }

    body {
        padding-bottom: 68px;
    }
}

/* Mobile menu slide-in */
#mobileMenu {
    transform: translateX(100%);
}

[dir="rtl"] #mobileMenu {
    transform: translateX(-100%);
}

#mobileMenu.open {
    transform: translateX(0) !important;
}

#mobileOverlay.open {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Mobile search modal */
#mobileSearchOverlay.open {
    opacity: 1 !important;
    visibility: visible !important;
}

#mobileSearchOverlay.open #mobileSearchBox {
    transform: translateY(0) !important;
}

/* Scrollbar hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ========================================
   Loading Spinner
   ======================================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.loading-spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Alert System
   ======================================== */
.alert-container {
    position: fixed;
    top: 25px;
    right: 6px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: calc(100% - 40px);
    pointer-events: none;
}

[dir="rtl"] .alert-container {
    right: auto;
    left: 6px;
}

/* Alert Base Styles */
.alert {
    top: 114px;
    position: relative;
    padding: 16px 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(0);
    transition: all 0.3s ease;
    animation: slideInRight 0.4s ease forwards;
    pointer-events: auto;
    z-index: 9999;
    overflow: hidden;
}

[dir="rtl"] .alert {
    animation: slideInLeft 0.4s ease forwards;
}

.alert.hiding {
    animation: slideOutRight 0.4s ease forwards;
}

[dir="rtl"] .alert.hiding {
    animation: slideOutLeft 0.4s ease forwards;
}

/* Alert Types */
.alert-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.alert-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #010F1C, #1a2532);
    color: white;
}

/* Alert Icon */
.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Alert Content */
.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.alert-message {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Alert Close Button */
.alert-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Progress Bar */
.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 16px 16px;
    width: 100%;
    overflow: hidden;
}

.alert-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    width: 100%;
    animation: progress 3s linear forwards;
    transform-origin: left;
}

[dir="rtl"] .alert-progress-bar {
    transform-origin: right;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .alert-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }

    .alert {
        padding: 12px 16px;
    }

    .alert-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .alert-title {
        font-size: 0.9rem;
    }

    .alert-message {
        font-size: 0.8rem;
    }
}

/* ========================================
   Product Card
   ======================================== */
.loading-spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hide number input arrows */
.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input {
    -moz-appearance: textfield;
}

/* Button states */
.add-to-cart-btn:active {
    transform: scale(0.97);
}

.add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Prevent layout shift */
.product-card {
    backface-visibility: hidden;
}

/* Mobile: keep action buttons hidden (override Tailwind group-hover) */
@media (max-width: 640px) {
    .product-card .product-actions {
        opacity: 0 !important;
        transform: translateX(8px) !important;
        pointer-events: none;
    }
}

/* Ensure image fills padded container */
.product-card .image-slideshow img {
    object-fit: cover;
}

/* ========================================
   Back to Top
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1E40AF 0%, #1E3A8A 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.05);
    color: white;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.back-to-top:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3), 0 4px 8px rgba(0, 0, 0, 0.1);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-180deg);
    }

    50% {
        transform: scale(1.1) rotate(10deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.back-to-top:hover i {
    transform: translateY(-5px) scale(1.2);
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0) scale(1.2);
    }

    50% {
        transform: translateY(-8px) scale(1.2);
    }
}

/* RTL Support */
[dir="rtl"] .back-to-top {
    right: auto;
    left: 40px;
}

[dir="rtl"] .back-to-top:hover {
    transform: translateY(-10px) scale(1.1) rotate(-5deg);
}

/* Responsive */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 90px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    [dir="rtl"] .back-to-top {
        right: auto;
        left: 20px;
    }

    .back-to-top.pill {
        width: 100px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 80px;
        width: 45px;
        height: 45px;
        font-size: 18px;
        border-radius: 15px;
    }
}

/* ========================================
   Hover Continuous Animations
   ======================================== */
@keyframes hoverPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4), 0 0 30px rgba(59, 130, 246, 0.15);
    }
}

@keyframes hoverFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes hoverGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes hoverWobble {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-2deg);
    }
    75% {
        transform: rotate(2deg);
    }
}

/* Gradient buttons: continuous gradient shift on hover */
[class*="bg-gradient-to-r"]:where(button, a):not(.no-hover-anim):hover,
[class*="bg-gradient-to-b"]:where(button, a):not(.no-hover-anim):hover {
    background-size: 200% 200%;
    animation: hoverGradient 3s ease infinite;
}

/* Buttons: continuous pulse glow on hover */
button:where(:not(.no-hover-anim):not(.slider-dot):not(.slick-arrow)):hover,
a:where([class*="btn"]):hover,
a:where([class*="button"]):hover,
[class*="bg-blue-"]:where(button, a, [role="button"]):not(.no-hover-anim):hover {
    animation: hoverPulse 2s ease-in-out infinite;
}

/* Category/section cards: continuous float on hover */
[class*="category"]:not(.no-hover-anim):hover,
[class*="cat-sidebar"]:not(.no-hover-anim):hover,
section[id*="categories"] [class*="rounded-2xl"]:not(.no-hover-anim):hover {
    animation: hoverFloat 3s ease-in-out infinite;
}

/* Category icons: gentle wobble on hover */
[class*="category"]:not(.no-hover-anim):hover [class*="w-16"],
[class*="category"]:not(.no-hover-anim):hover [class*="w-20"],
[class*="category"]:not(.no-hover-anim):hover [class*="w-24"] {
    animation: hoverWobble 2s ease-in-out infinite;
}

/* Back to top icon: continuous bounce on hover (enhance existing) */
.back-to-top:hover i {
    animation: bounce 1s ease-in-out infinite !important;
}

/* ===== Product Description Tab Tables ===== */
#tab1 table,
.tab-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 16px;
    border: 1px solid #D5D9D9;
    background: #fff;
}
#tab1 th,
#tab1 td,
.tab-content th,
.tab-content td {
    padding: 9px 12px;
    border: 1px solid #D5D9D9;
    vertical-align: middle;
}
#tab1 th,
.tab-content th {
    background: #f0f2f2;
    font-weight: 700;
    text-align: start;
}
#tab1 td,
.tab-content td {
    background: #fff;
}

