/* 台灣愛文芒果線上商店 - 全域樣式 */

:root {
    --primary-color: #FFA500;
    --secondary-color: #FFD700;
    --dark-color: #333;
    --light-color: #f8f9fa;
    --border-radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    background-color: #fff;
}

/* 導航欄 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    transition: color 0.3s;
}

.navbar-brand:hover {
    color: var(--secondary-color) !important;
}

/* 英雄區 */
.hero {
    min-height: 500px;
    display: flex;
    align-items: center;
    background-attachment: fixed;
}

.hero h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* 按鈕 */
.btn-warning {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-warning:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-outline-light {
    border-width: 2px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-outline-light:hover {
    background-color: white;
    color: var(--primary-color);
}

/* 卡片 */
.card {
    transition: all 0.3s;
    border-radius: var(--border-radius);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

.product-card {
    overflow: hidden;
}

.product-card img {
    transition: transform 0.3s;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* 徽章 */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* 表單 */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 165, 0, 0.25);
}

/* 表格 */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead {
    background-color: var(--light-color);
}

.table tbody tr:hover {
    background-color: rgba(255, 165, 0, 0.05);
}

/* 狀態徽章 */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.875rem;
}

.status-pending {
    background-color: #ffc107;
    color: #000;
}

.status-shipped {
    background-color: #17a2b8;
    color: #fff;
}

.status-completed {
    background-color: #28a745;
    color: #fff;
}

/* 分頁 */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-link.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 警告/成功訊息 */
.alert {
    border-radius: var(--border-radius);
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* 頁尾 */
footer {
    margin-top: auto;
    border-top: 2px solid var(--primary-color);
}

footer a {
    transition: color 0.3s;
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* 購物車 */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background-color: var(--light-color);
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.cart-item:hover {
    background-color: rgba(255, 165, 0, 0.05);
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* 訂單追蹤 */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50px;
    width: 2px;
    height: calc(100% + 1rem);
    background-color: #ddd;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-color);
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-marker.active {
    background-color: var(--primary-color);
    color: white;
}

.timeline-content {
    flex: 1;
    padding-top: 0.5rem;
}

.timeline-content h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.timeline-content p {
    margin-bottom: 0;
    color: #666;
    font-size: 0.875rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero {
        min-height: 350px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .cart-item {
        flex-direction: column;
    }

    .cart-item img {
        width: 100%;
        height: 200px;
    }

    .timeline-item {
        gap: 0.5rem;
    }

    .timeline-marker {
        width: 30px;
        height: 30px;
    }

    .timeline-item::before {
        left: 15px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .display-4 {
        font-size: 2rem;
    }
}

/* 動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* 載入動畫 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 165, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 列印樣式 */
@media print {
    .navbar,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }

    body {
        background-color: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
