/* =====================================================================
   Gem Size (Carat) Dropdown — assets/gem-size-dropdown.css
   Companion stylesheet for the GemSizeDropdown component.
   ===================================================================== */

.gem-size-dropdown {
    position: relative;
    width: 100%;
    font-family: inherit;
    color: var(--ink, #1a1714);
}

.gsd-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid var(--line, #ece7e0);
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--ink, #1a1714);
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gsd-trigger:hover { border-color: var(--line-strong, #d8d1c6); }
.gem-size-dropdown.open .gsd-trigger {
    border-color: #8a7f6f;
    box-shadow: 0 0 0 1px #8a7f6f;
}

.gsd-trigger-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}
.gsd-trigger-primary {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--ink, #1a1714);
    font-variant-numeric: tabular-nums;
}
.gsd-trigger-secondary {
    font-size: 0.7rem;
    color: var(--ink-mute, #9b948c);
    letter-spacing: 0.02em;
}
.gsd-trigger-placeholder { color: var(--ink-mute, #9b948c); font-weight: 400; }

.gsd-chevron {
    width: 12px; height: 12px;
    color: var(--ink-soft, #5b554f);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.gem-size-dropdown.open .gsd-chevron { transform: rotate(180deg); }

.gsd-menu {
    /* Default fallback positioning (position is overridden to `fixed`
       by JS when the dropdown opens, so the menu escapes any ancestor
       that clips via overflow: hidden — accordion sections, etc.) */
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--line-strong, #d8d1c6);
    border-radius: var(--radius-sm, 6px);
    box-shadow: 0 8px 24px rgba(26,23,20,.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    padding: 4px;
    display: none;
}
.gem-size-dropdown.open .gsd-menu { display: block; }

.gsd-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ink, #1a1714);
    transition: background 0.12s ease;
}
.gsd-option:hover { background: #faf7f2; }
.gsd-option.active { background: #f4efe6; }
.gsd-option.selected {
    background: #8a7f6f;
    color: #fff;
}
.gsd-option.selected .gsd-opt-sub { color: rgba(255,255,255,0.65); }

.gsd-opt-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.gsd-opt-carat {
    font-weight: 600;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.005em;
}
.gsd-opt-unit {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}
.gsd-opt-sub {
    font-size: 0.7rem;
    color: var(--ink-mute, #9b948c);
    font-variant-numeric: tabular-nums;
}

.gsd-empty {
    padding: 0.7rem;
    text-align: center;
    color: var(--ink-mute, #9b948c);
    font-size: 0.8rem;
    font-style: italic;
}
