/**
 * VeraCita Product Switcher Styles
 * Cross-product navigation component
 */

/* ============================================
   CONTAINER
   ============================================ */

.product-switcher-container {
    position: relative;
    z-index: 1000;
}

/* ============================================
   PRODUCT SWITCHER
   ============================================ */

.product-switcher {
    position: relative;
    display: inline-flex;
}

/* ============================================
   TRIGGER BUTTON
   ============================================ */

.product-switcher-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.product-switcher-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.product-switcher-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.product-switcher.open .product-switcher-trigger {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Trigger Icon */
.product-switcher-trigger .trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.product-switcher-trigger .trigger-icon svg {
    width: 18px;
    height: 18px;
}

/* Trigger Label */
.product-switcher-trigger .trigger-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Trigger Chevron */
.product-switcher-trigger .trigger-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.product-switcher-trigger .trigger-chevron svg {
    width: 14px;
    height: 14px;
}

.product-switcher.open .trigger-chevron {
    transform: rotate(180deg);
}

/* ============================================
   DROPDOWN
   ============================================ */

.product-switcher-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 40px -10px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.product-switcher.open .product-switcher-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Header */
.product-switcher-dropdown .dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.product-switcher-dropdown .dropdown-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dropdown Section */
.product-switcher-dropdown .dropdown-section {
    padding: 8px;
}

/* Dropdown Divider */
.product-switcher-dropdown .dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 8px;
}

/* ============================================
   DROPDOWN ITEMS
   ============================================ */

.product-switcher-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.product-switcher-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.product-switcher-dropdown .dropdown-item:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

/* Item Icon */
.product-switcher-dropdown .item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}

.product-switcher-dropdown .item-icon svg {
    width: 20px;
    height: 20px;
}

/* All Products item */
.product-switcher-dropdown .dropdown-item.all-products .item-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Product item with custom color */
.product-switcher-dropdown .dropdown-item.product-item .item-icon {
    background: color-mix(in srgb, var(--product-color, #3b82f6) 20%, transparent);
}

/* Item Content */
.product-switcher-dropdown .item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.product-switcher-dropdown .item-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.product-switcher-dropdown .item-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Active Indicator */
.product-switcher-dropdown .item-active-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--vc-status-supported);
    flex-shrink: 0;
}

.product-switcher-dropdown .item-active-indicator svg {
    width: 16px;
    height: 16px;
}

/* Active Item */
.product-switcher-dropdown .dropdown-item.active {
    background: rgba(16, 185, 129, 0.1);
}

.product-switcher-dropdown .dropdown-item.active:hover {
    background: rgba(16, 185, 129, 0.15);
}

/* ============================================
   LIGHT THEME
   ============================================ */

body.light-theme .product-switcher-trigger,
.light-theme .product-switcher-trigger {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

body.light-theme .product-switcher-trigger:hover,
.light-theme .product-switcher-trigger:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .product-switcher.open .product-switcher-trigger,
.light-theme .product-switcher.open .product-switcher-trigger {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .product-switcher-dropdown,
.light-theme .product-switcher-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

body.light-theme .product-switcher-dropdown .dropdown-header,
.light-theme .product-switcher-dropdown .dropdown-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .product-switcher-dropdown .dropdown-title,
.light-theme .product-switcher-dropdown .dropdown-title {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme .product-switcher-dropdown .dropdown-divider,
.light-theme .product-switcher-dropdown .dropdown-divider {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .product-switcher-dropdown .dropdown-item,
.light-theme .product-switcher-dropdown .dropdown-item {
    color: #1f2937;
}

body.light-theme .product-switcher-dropdown .dropdown-item:hover,
.light-theme .product-switcher-dropdown .dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .product-switcher-dropdown .item-icon,
.light-theme .product-switcher-dropdown .item-icon {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .product-switcher-dropdown .dropdown-item.all-products .item-icon,
.light-theme .product-switcher-dropdown .dropdown-item.all-products .item-icon {
    background: rgba(59, 130, 246, 0.1);
}

body.light-theme .product-switcher-dropdown .dropdown-item.product-item .item-icon,
.light-theme .product-switcher-dropdown .dropdown-item.product-item .item-icon {
    background: color-mix(in srgb, var(--product-color, #3b82f6) 10%, transparent);
}

body.light-theme .product-switcher-dropdown .item-name,
.light-theme .product-switcher-dropdown .item-name {
    color: #1f2937;
}

body.light-theme .product-switcher-dropdown .item-description,
.light-theme .product-switcher-dropdown .item-description {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme .product-switcher-dropdown .dropdown-item.active,
.light-theme .product-switcher-dropdown .dropdown-item.active {
    background: rgba(16, 185, 129, 0.08);
}

body.light-theme .product-switcher-dropdown .dropdown-item.active:hover,
.light-theme .product-switcher-dropdown .dropdown-item.active:hover {
    background: rgba(16, 185, 129, 0.12);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .product-switcher-trigger .trigger-label {
        display: none;
    }

    .product-switcher-trigger {
        padding: 8px;
    }

    .product-switcher-dropdown {
        min-width: 260px;
        right: 0;
        left: auto;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes product-switcher-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-switcher.open .product-switcher-dropdown {
    animation: product-switcher-dropdown-in 0.2s ease forwards;
}
