/* ============================================
   ASTROESSENTIAL - COMMON THEME UTILITIES
   Theme-Independent Styles Only
   ============================================ */

/* Animations - Theme Independent */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Zodiac Wheel Decoration - Theme Independent Position */
.zodiac-wheel {
    position: absolute;
    pointer-events: none;
}

/* Floating Animation */
@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.motion-safe\:floaty {
    animation: float 6s ease-in-out infinite;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .motion-safe\:floaty {
        transform: none !important;
        animation: none !important;
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Focus Visible - Accessibility */
*:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Selection Styles - Theme Independent Structure */
::selection {
    /* Colors defined in theme-specific CSS */
}

::-moz-selection {
    /* Colors defined in theme-specific CSS */
}

/* Transition Utilities */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Loading Spinner Structure */
.spinner {
    width: 40px;
    height: 40px;
    position: relative;
    margin: 20px auto;
}

.spinner::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid;
    border-color: currentColor transparent currentColor transparent;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Container Max Widths */
.container-custom {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container-custom {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-custom {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Aspect Ratios */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-portrait {
    aspect-ratio: 3 / 4;
}

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

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

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

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    header,
    footer,
    .sidebar,
    .mobile-menu {
        display: none !important;
    }

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

/* Sort Dropdown - Dark Theme Default */
.sort-dropdown {
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: #e0ddd7 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-dropdown:hover {
    background-color: rgba(0, 0, 0, 0.9) !important;
    border-color: rgba(184, 145, 79, 0.5) !important;
}

.sort-dropdown:focus {
    border-color: #b8914f !important;
    box-shadow: 0 0 0 3px rgba(184, 145, 79, 0.2) !important;
    outline: none !important;
}

.sort-dropdown option {
    background-color: #1a1a1a !important;
    color: #e0ddd7 !important;
    padding: 10px !important;
}

.sort-dropdown option:hover,
.sort-dropdown option:checked {
    background-color: rgba(184, 145, 79, 0.3) !important;
    color: #b8914f !important;
}

/* Custom dropdown arrow */
.sort-dropdown {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b8914f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ============================================
   PASSWORD TOGGLE ICON - Theme Aware
   ============================================ */
.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    transition: color 0.2s ease;
}

/* ============================================
   LOCALE PREFERENCE MODAL - Theme Aware
   ============================================ */
.locale-modal-overlay {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.locale-modal-container {
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 32rem;
    width: 100%;
}

/* ============================================
   DROPDOWN MENU ITEMS - Base Structure
   ============================================ */
.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu-item-danger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.language-dropdown-item,
.currency-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ============================================
   MEGA MENU ITEMS - Base Structure
   ============================================ */
.mega-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mega-menu-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border-radius: 0.75rem;
    border-width: 1px;
    transition: all 0.2s ease;
}

/* ============================================
   DROPDOWN CONTAINERS - Base Structure
   ============================================ */
.dropdown-container {
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.locale-modal-header {
    padding: 1.5rem;
    border-bottom-width: 1px;
}

.locale-modal-content {
    padding: 1.5rem;
}

.locale-modal-footer {
    padding: 1.5rem;
    border-top-width: 1px;
    display: flex;
    gap: 0.75rem;
}

.locale-option,
.currency-option {
    position: relative;
    cursor: pointer;
}

.locale-option-inner,
.currency-option-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border-width: 2px;
    transition: all 0.2s ease;
}

.locale-modal-btn-primary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.locale-modal-btn-secondary {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border-width: 1px;
    transition: all 0.2s ease;
}

/* Order Filter Tabs - Common Structure */
.order-filter {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* ============================================
   PRODUCT TABS - Enhanced Design
   ============================================ */

/* Tab Navigation */
.product-tabs-nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
}

.product-tabs-nav::-webkit-scrollbar {
    display: none;
}

.product-tab-btn {
    position: relative;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    outline: none;
    background: transparent;
}

.product-tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.product-tab-btn.active::after {
    transform: scaleX(1);
}

/* Tab Content Container */
.product-tab-content {
    padding: 2rem 0;
}

/* Product Details Grid - Side by Side Layout */
.product-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .product-details-grid {
        grid-template-columns: 1.5fr 1fr;
        gap: 3rem;
    }
}

.product-description-section {
    padding-right: 1.5rem;
}

@media (min-width: 1024px) {
    .product-description-section {
        border-right: 1px solid;
        padding-right: 2rem;
    }
}

.product-specs-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid;
}

/* Specifications List */
.specs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.spec-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: baseline;
    padding: 0.625rem 0.875rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.spec-label {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
}

.spec-value {
    font-weight: 400;
    font-size: 0.875rem;
    text-align: right;
    word-break: break-word;
}

/* Spec Section Divider */
.spec-divider {
    margin: 0.75rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid;
}

/* Empty State */
.specs-empty-state {
    text-align: center;
    padding: 2rem 1rem;
}
