/**
 * Drawer (側邊抽屜) 樣式
 * 玻璃擬態風格，從右側滑出
 */

/* 抽屜遮罩 */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* 抽屜主體 */
.drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    font-family: 'Noto Serif TC', serif;
}

.drawer.open {
    right: 0;
}

/* 抽屜標題區 */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.drawer-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* 抽屜內容區 */
.drawer-body {
    padding: 20px;
    flex: 1;
}

/* 抽屜底部區 */
.drawer-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 地址列表樣式 */
.drawer-address-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.drawer-address-item {
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: all 0.2s;
    cursor: pointer;
}

.drawer-address-item:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--color-gold, #d4af37);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.drawer-address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.info-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.name {
    font-weight: 600;
    color: #333;
}

.phone {
    color: #666;
    font-size: 0.9rem;
}

.tag-default {
    font-size: 12px;
    background: #C9A962;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.action-group {
    display: flex;
    gap: 4px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #999;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.btn-icon.delete:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4d4f;
}

.drawer-address-body {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 表單樣式 */
.drawer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.address-form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.select-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.drawer-select, .drawer-input {
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    transition: all 0.2s;
}

.drawer-select {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.drawer-input {
    width: 100%;
}

.drawer-input.small {
    width: 80px;
    text-align: center;
}

.drawer-select:focus, .drawer-input:focus {
    outline: none;
    border-color: var(--color-gold, #d4af37);
    background: rgba(255, 255, 255, 0.95);
}

.drawer-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.drawer-form-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.drawer-form-input {
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: all 0.2s;
}

.drawer-form-input:focus {
    outline: none;
    border-color: var(--color-gold, #d4af37);
    background: rgba(255, 255, 255, 0.95);
}

.drawer-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 按鈕樣式 */
.drawer-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.drawer-btn-primary {
    background: var(--color-gold, #d4af37);
    color: white;
}

.drawer-btn-primary:hover {
    background: var(--color-gold-dark, #b8941f);
    transform: translateY(-1px);
}

.drawer-btn-outline {
    background: transparent;
    color: #666;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.drawer-btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #333;
}

.drawer-btn-full {
    width: 100%;
    justify-content: center;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .drawer {
        width: 100%;
        right: -100%;
    }
    
    .drawer-header,
    .drawer-body,
    .drawer-footer {
        padding: 15px;
    }
}

/* 動畫效果 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

.drawer.open {
    animation: slideIn 0.3s ease-in-out;
}

.drawer-backdrop.open {
    animation: fadeIn 0.3s ease-in-out;
}

/* 空狀態 */
.drawer-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.drawer-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.drawer-empty-text {
    font-size: 1rem;
    margin-bottom: 20px;
}
