/* ============================================
   Base Styles — Shared across all themes
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Hide Utility */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Language Switcher (Modern Globe Popup) */
[class$="-lang"],
.lang-switcher {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 100;
}

.lang-globe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.lang-globe-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.lang-globe-btn:active {
    transform: scale(0.95);
}

.lang-globe-btn svg {
    width: 20px;
    height: 20px;
    color: #374151;
    transition: transform 0.3s ease;
}

.lang-globe-btn:hover svg {
    transform: rotate(15deg);
}

/* Language Popup Modal */
.lang-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.2s ease;
}

.lang-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-popup {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 24px;
    min-width: 280px;
    max-width: 320px;
    animation: slideUp 0.3s ease;
    position: relative;
}

.lang-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #6b7280;
}

.lang-popup-close:hover {
    background: #e5e7eb;
    color: #111827;
    transform: rotate(90deg);
}

.lang-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: -0.01em;
}

.lang-popup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lang-popup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    background: #f9fafb;
    border: 2px solid transparent;
}

.lang-popup-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.lang-popup-item.active {
    background: #eff6ff;
    border-color: #3b82f6;
}

.lang-popup-flag {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lang-popup-flag-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-popup-item-text {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.lang-popup-item-code {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    padding: 4px 8px;
    background: white;
    border-radius: 6px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Country Code Selector for Phone Input */
.country-selector {
    position: relative;
    display: inline-block;
}

.country-selector-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.country-selector-btn:hover {
    background: #f3f4f6;
}

.country-selector-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.country-flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 2px rgba(0,0,0,0.1);
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 350px;
    overflow-y: auto;
    min-width: 280px;
    display: none;
    padding: 8px;
}

.country-dropdown.active {
    display: block;
}

/* Search Input */
.country-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.country-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.country-search-input::placeholder {
    color: #9ca3af;
}

/* Country Items Container */
.country-dropdown-items {
    max-height: 280px;
    overflow-y: auto;
}

.country-dropdown-items::-webkit-scrollbar {
    width: 6px;
}

.country-dropdown-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.country-dropdown-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.country-dropdown-items::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.country-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f3f4f6;
}

.country-dropdown-item:last-child {
    border-bottom: none;
}

.country-dropdown-item:hover {
    background: #f9fafb;
}

.country-dropdown-item.active {
    background: #eff6ff;
}

.country-dropdown-code {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    min-width: 50px;
}

.country-dropdown-name {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
}

/* Phone Input with Country Code */
.phone-field {
    width: 100%;
}

.phone-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-input-wrapper .country-selector {
    flex-shrink: 0;
}

.phone-input-wrapper input {
    flex: 1;
    min-width: 0;
}

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

/* Print Styles */
@media print {
    nav, [class$="-lang"], .lang-switcher, #cart-fab, button {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
}
