/* 主頁面樣式 */

/* 卡片效果樣式 */
.hover-shadow {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}
.hover-shadow::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 0 10px 20px rgba(0,0,0,.2);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 12px;
}
.hover-shadow:hover {
    transform: translateY(-8px) scale(1.03);
}
.hover-shadow:hover::after {
    opacity: 1;
}

/* 側邊欄樣式 */
.sidebar {
    background: #f5e6d8;
    height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
}
.sidebar .nav-link {
    color: #3a1e00 !important;
    font-weight: 700;
    background: transparent;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff !important;
    background: #a6261c !important;
}

/* 導航連結樣式 */
.nav-link {
    color: #333;
    padding: .5rem 1rem;
    border-radius: .25rem;
}
.nav-link:hover {
    background-color: #e9ecef;
}

/* 主要頁面區塊 */
.text-center.py-4 h1.display-5 {
    font-size: 2.5rem; 
    color: #333;
}

.text-center.py-4 h2.text-primary {
    font-size: 2rem; 
    color: #0d6efd !important; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.text-center.py-4 p.lead {
    font-size: 1.25rem; 
    color: #666 !important; 
    max-width: 80%; 
    margin: 0 auto 1.5rem;
}

/* 選項切換按鈕區 */
.option-switcher {
    padding: 0.5rem; 
    background: #f8f9fa; 
    border-radius: 15px; 
    display: inline-flex; 
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.option-switcher .btn-option {
    font-size: 1.3rem; 
    padding: 0.75rem 2rem; 
    margin: 0 5px; 
    border-radius: 12px;
}

/* 手機版分類快速導航欄 */
.category-nav-scroller {
    padding: 12px 5px; 
    background: #f8f9fa; 
    border-radius: 12px; 
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    position: sticky;
    top: 56px;
    z-index: 1000;
}

.category-nav-scroller::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.category-nav-item {
    font-size: 1.2rem; 
    padding: 10px 20px; 
    margin: 0 5px; 
    border-radius: 30px; 
    background: white; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); 
    white-space: nowrap; 
    color: #333; 
    text-decoration: none; 
    font-weight: 500;
}

/* 類別標題樣式 */
.category-title-container {
    border-radius: 10px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    background: linear-gradient(135deg, #f8f9fa, #e9ecef); 
    margin-bottom: 15px; 
    padding: 0.5rem;
}

.category-title {
    font-size: 1.8rem; 
    color: #333; 
    padding: 10px; 
    margin: 0;
}

.description-text {
    font-size: 1.1rem; 
    padding: 0 10px 10px;
}

/* 回到頂部按鈕 */
#backToTopBtn {
    bottom: 80px; 
    right: 17px; 
    z-index: 1050; 
    background: linear-gradient(135deg, #0d6efd, #0a58ca); 
    color: white; 
    border: none; 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4); 
    font-size: 1.5rem;
}

#backToTopBtn:hover {
    background-color: #f8f9fa;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Modal 樣式 */
#quantityModal .modal-header {
    background: linear-gradient(135deg, #eaf2fd, #e6f0ff); 
    padding: 1.2rem 1.5rem; 
    border-radius: 15px 15px 0 0; 
    border: none;
}

#quantityModal .modal-title {
    font-size: 1.5rem; 
    font-weight: bold; 
    color: #0d6efd;
}

#quantityModal .btn-close {
    font-size: 1.2rem; 
    padding: 1rem; 
    background-color: #dee2e6;
}

#quantityModal .modal-body {
    padding: 1.5rem 1.8rem;
}

#modalProductName {
    font-size: 1.8rem; 
    font-weight: bold; 
    color: #212529; 
    padding: 10px; 
    background-color: #f8f9fa; 
    border-radius: 10px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#quantityModal .modal-footer {
    padding: 1.25rem; 
    background-color: #f8f9fa; 
    border-radius: 0 0 15px 15px; 
    border: none;
}

#quantityModal .btn-secondary {
    font-size: 1.3rem; 
    padding: 0.75rem 1.5rem; 
    border-radius: 10px; 
    background-color: #6c757d; 
    font-weight: 500;
}

#quantityModal .btn-primary {
    font-size: 1.3rem; 
    padding: 0.75rem 1.5rem; 
    border-radius: 10px; 
    background: linear-gradient(135deg, #0d6efd, #0b5ed7); 
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3); 
    font-weight: 500;
}

/* 選項容器樣式 */
.options-wrapper {
    max-height: 350px;
    overflow-y: auto;
    padding: 1.4rem;
    border-radius: 12px;
    background-color: #f8f9fa;
    margin-bottom: 1.8rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
}

/* 選項項目樣式 */
.option-item {
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
}
.option-item:hover {
    transform: translateX(8px);
    background-color: #f8f9fa;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    border-color: #0d6efd;
}

/* 選項文字樣式 */
.option-item .form-check-label {
    font-size: 0.95rem;
}

@media (min-width: 992px) {
    .option-item .form-check-label {
        font-size: 0.9rem;
    }
    
    #drinkOptionsContainer .form-check-label {
        font-size: 0.9rem;
    }
}

/* 選項輸入框樣式 */
.form-check-input {
    width: 1.6em;
    height: 1.6em;
    margin-top: 0.25em;
    cursor: pointer;
    border: 2px solid #ccc;
}
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}
.form-check-label {
    font-size: 1.15rem;
    padding-left: 0.5rem;
    cursor: pointer;
}

/* 選項價格樣式 */
.option-price {
    font-weight: 500;
    color: #0d6efd;
}

/* 數量控制樣式 */
.quantity-control {
    background: #f0f2f5;
    padding: 0.8rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.quantity-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.quantity-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

#modalQuantity {
    font-size: 1.5rem;
    font-weight: bold;
    width: 80px;
    text-align: center;
    border: none;
    background: white;
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.1);
    border-radius: 12px;
}

/* 飲料選項區域樣式 */
#drinkOptionsContainer {
    background-color: #f0f7ff; 
    padding: 1.5rem; 
    border-radius: 15px; 
    box-shadow: 0 3px 10px rgba(0,0,0,0.08); 
    border: 1px solid #cfe2ff;
}

#drinkOptionsContainer h5 {
    font-size: 1.5rem; 
    color: #0d6efd; 
    font-weight: bold; 
    text-align: center; 
    padding-bottom: 0.8rem;
}

#upgradeDrinkContainer {
    background-color: #fff6f6;
    border-radius: 12px;
    padding: 18px 15px;
    border: 2px dashed #dc3545;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.1);
    position: relative;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.upgrade-drink-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#upgradeDrinkContainer::before {
    content: "升級飲料";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #fff;
    color: #dc3545;
    padding: 2px 10px;
    font-size: 1rem;
    font-weight: bold;
    border: 2px dashed #dc3545;
    border-radius: 20px;
}

#upgradeDrinkToggleBtn {
    transition: all 0.3s ease;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#upgradeDrinkToggleBtn:hover {
    background-color: #0d6efd;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#drinkOptionsContainer h5,
#drinkCustomOptionsContainer h6 {
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
    padding-bottom: 10px;
}

/* 標準與升級飲料樣式區分 */
#standardDrinkOptionsList .option-item {
    border-left: 5px solid #0d6efd;
    position: relative;
}

#standardDrinkOptionsList .option-item::before {
    content: "標準";
    position: absolute;
    top: -8px;
    right: 10px;
    font-size: 0.75rem;
    background: #0d6efd;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    opacity: 0.8;
}

#upgradeDrinkOptionsList .option-item {
    border-left: 5px solid #dc3545;
    position: relative;
}

#upgradeDrinkOptionsList .option-item::before {
    content: "升級";
    position: absolute;
    top: -8px;
    right: 10px;
    font-size: 0.75rem;
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    opacity: 0.8;
}

/* 飲料客製化選項樣式 */
#drinkCustomOptions .option-item {
    border-left: 5px solid #20c997;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

#drinkCustomOptions .option-item:hover {
    background-color: #f0fff8;
    transform: translateX(8px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

#drinkCustomOptions .option-item:active {
    transform: translateX(4px);
    background-color: #e0fef0;
}

/* 選項選中狀態樣式 */
#drinkCustomOptions .option-item input:checked + label {
    font-weight: bold;
    color: #20c997;
}

#drinkCustomOptions .option-item input:checked ~ label::after {
    content: " ✓";
    color: #20c997;
}

#drinkCustomOptions .option-item input:checked {
    border-color: #20c997;
    background-color: #20c997;
}

/* 飲料選項/客製化選項點擊效果 */
.option-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 選項通用的選中狀態增強 */
.form-check input[type="radio"]:checked + label {
    font-weight: bold;
}

/* 視覺反饋增強 */
.option-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* 商品卡片樣式 */
.card-title.product-name {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1.45;
    word-wrap: break-word;
    word-break: break-all;
    color: #333;
    margin-bottom: 8px;
}

.card-text.description-text {
    font-size: 1.15rem;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-all;
    color: #555;
}

/* 價格標籤樣式 */
.price-tag {
    min-width: 70px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    font-weight: 600;
    font-size: 1.15rem;
    border-radius: 30px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

/* 卡片內容結構樣式 */
.card-body {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border-radius: 12px;
    background: linear-gradient(to bottom, #ffffff, #f9f9f9);
}

.product-header {
    margin-bottom: 12px;
    position: relative;
}

.product-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.product-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed rgba(0,0,0,0.08);
}

/* 購物車按鈕樣式 */
.add-to-cart-btn {
    transition: all 0.3s ease;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    white-space: normal;
    height: auto;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0d6efd;
    color: white;
    border: none;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.add-to-cart-btn i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.add-to-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
    background-color: #0b5ed7;
}

.add-to-cart-btn:active {
    transform: translateY(0);
    background-color: #0a58ca;
}

/* 卡片樣式 */
.card {
    transition: all 0.35s ease;
    border: none;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 16px;
    background-color: #fff;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* 手機版優化樣式 */
@media (max-width: 767px) {
    .card-title.product-name {
        font-size: 1.25rem;
        line-height: 1.35;
        margin-bottom: 8px;
    }
    .card-text.description-text {
        font-size: 1.05rem;
        line-height: 1.4;
        margin-bottom: 0.8rem;
    }
    .card-body {
        padding: 1.1rem 1rem;
    }
    .price-tag {
        font-size: 1.1rem;
        padding: 0.3rem 0.5rem;
    }
    .add-to-cart-btn {
        font-size: 1.15rem;
        padding: 0.5rem 0.8rem;
        margin-top: 8px;
    }
    .add-to-cart-btn i {
        font-size: 1.1rem;
        margin-right: 0.4rem;
    }
    h1.display-5 {
        font-size: 2.1rem !important;
    }
    h2.text-primary {
        font-size: 1.8rem !important;
    }
    
    /* Modal 手機版優化 */
    #quantityModal .modal-dialog {
        margin: 1rem auto;
        max-width: 90%;
    }
    
    #quantityModal .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    #quantityModal .modal-body {
        padding: 1.2rem;
    }
    
    #modalProductName {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* 確保Modal在手機螢幕上垂直居中 */
    .modal-dialog-centered {
        display: flex;
        align-items: center;
        min-height: calc(100% - 2rem);
    }
}
