/**
 * Default Theme Stylesheet
 * iShops Theme System
 */

/* ========== Base Styles ========== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--shop-text);
    background-color: var(--shop-bg);
    line-height: 1.6;
    padding-bottom: 0;
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: var(--mobile-nav-height);
    }
}

a {
    color: var(--shop-text);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--shop-primary);
}

/* ========== Header ========== */
.shop-header {
    background: #fff;
    border-bottom: 1px solid var(--shop-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.shop-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
}

/* Logo */
.shop-logo {
    display: flex;
    align-items: center;
}

.shop-logo img {
    max-height: 50px;
    width: auto;
}

.shop-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-primary);
}

/* Desktop Navigation */
.shop-nav {
    display: none;
    align-items: center;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .shop-nav {
        display: flex;
    }
}

.shop-nav a {
    color: var(--shop-text);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding: 0.5rem 0;
}

.shop-nav a:hover,
.shop-nav a.active {
    color: var(--shop-primary);
}

/* Navigation Dropdown (下拉選單模式) */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--shop-text);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

.nav-dropdown-toggle:hover {
    color: var(--shop-primary);
}

.nav-dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-toggle i {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    background: #fff;
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 10px rgba(0,0,0,0.08);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    transform: translateX(-50%) translateY(8px);
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu .dropdown-item {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--shop-text);
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu .dropdown-item:hover {
    background: var(--shop-primary-bg, #f0fdf4);
    color: var(--shop-primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    padding: 0.5rem;
    color: var(--shop-text);
    background: none;
    border: none;
    order: 3;
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Header Actions (搜尋、會員、購物車按鈕) */
.shop-header-actions {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .shop-header-actions {
        display: flex;
    }
}

.header-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--shop-text);
    transition: color 0.2s;
}

.header-action-btn:hover {
    color: var(--shop-primary);
}

.header-action-btn i {
    font-size: 1.125rem;
}

/* Logo 置中佈局 */
.header-logo-center .container {
    justify-content: center;
}

.header-logo-center .shop-logo {
    order: 2;
    margin: 0 2rem;
}

.header-logo-center .shop-nav-left {
    order: 1;
    justify-content: flex-end;
}

.header-logo-center .shop-nav-right {
    order: 3;
    justify-content: flex-start;
}

.header-logo-center .shop-header-actions {
    order: 4;
    margin-left: auto;
}

.header-logo-center .mobile-menu-toggle {
    order: 5;
}

@media (min-width: 768px) {
    .header-logo-center .shop-nav-left,
    .header-logo-center .shop-nav-right {
        display: flex;
        flex: 1;
    }
}

/* Mobile Layout */
@media (max-width: 767.98px) {
    .shop-header .container {
        justify-content: space-between;
    }
    .shop-logo {
        order: 1;
    }
    .shop-nav {
        order: 2;
    }
    .shop-header-actions {
        order: 2;
    }
    .mobile-menu-toggle {
        order: 3;
    }
    /* 置中佈局在手機版恢復左側 Logo */
    .header-logo-center .shop-logo {
        order: 1;
        margin: 0;
    }
    .header-logo-center .shop-nav-left,
    .header-logo-center .shop-nav-right {
        display: none;
    }
}

/* ========== Floating Social Buttons ========== */
.floating-social {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 767.98px) {
    .floating-social {
        right: 10px;
        gap: 6px;
    }
}

.floating-social a,
.floating-social button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

@media (max-width: 767.98px) {
    .floating-social a,
    .floating-social button {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

.floating-social a:hover,
.floating-social button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.floating-social .btn-facebook { background: #1877f2; }
.floating-social .btn-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.floating-social .btn-youtube { background: #ff0000; }
.floating-social .btn-line { background: #00b900; }
.floating-social .btn-phone { background: #f97316; }
.floating-social .btn-top {
    background: #fff;
    color: var(--shop-text);
    border: 1px solid var(--shop-border);
}
.floating-social .btn-top:hover {
    background: var(--shop-bg-gray);
}

/* ========== Main Content ========== */
.shop-main {
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* ========== Product Cards ========== */
.product-card {
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid var(--shop-border, #e5e7eb);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--shop-primary, #1E5A82);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.product-card-image {
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background: #f8f8f8;
    border-radius: 12px 12px 0 0;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.discount-badge {
    background: var(--shop-danger);
    color: #fff;
}

.product-card-body {
    padding: 1rem 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--shop-text);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.product-card-desc {
    font-size: 0.8rem;
    color: var(--shop-text-muted);
    margin-bottom: 0.5rem;
}

.product-card-price {
    margin-top: auto;
}

.price-original {
    font-size: 0.85rem;
    color: var(--shop-text-muted);
    text-decoration: line-through;
}

.price-current {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--shop-price);
}

/* ========== Section Headers ========== */
.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--shop-text);
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--shop-primary);
    margin: 0.75rem auto 0;
}

/* ========== Footer ========== */
.shop-footer {
    background: var(--shop-bg-gray);
    border-top: 1px solid var(--shop-border);
    padding: 2rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--shop-text);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--shop-primary);
}

.footer-info {
    text-align: center;
    margin-bottom: 1rem;
}

.footer-info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--shop-text);
}

.footer-info-row span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-copyright {
    text-align: center;
    font-size: 0.8rem;
    color: var(--shop-text-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--shop-border);
}

/* ========== Mobile Bottom Navigation ========== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: #fff;
    border-top: 1px solid var(--shop-border);
    z-index: 1000;
    padding: 0 0.5rem;
}

@media (max-width: 767.98px) {
    .mobile-nav {
        display: flex;
    }
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    color: var(--shop-text-muted);
    font-size: 0.625rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.mobile-nav-item.active {
    color: var(--shop-primary);
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item .badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(14px);
    background: var(--shop-danger);
    color: #fff;
    font-size: 0.5rem;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ========== Offcanvas Menu ========== */
.offcanvas-menu {
    max-width: 300px;
}

.offcanvas-menu .offcanvas-header {
    border-bottom: 1px solid var(--shop-border);
}

.offcanvas-menu .nav-link {
    padding: 0.875rem 1rem;
    color: var(--shop-text);
    font-weight: 500;
    border-bottom: 1px solid var(--shop-border);
}

.offcanvas-menu .nav-link:hover,
.offcanvas-menu .nav-link.active {
    color: var(--shop-primary);
    background: var(--shop-bg-gray);
}

/* ========== Buttons ========== */
.btn-add-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    color: var(--shop-price);
    border: 2px solid var(--shop-price);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-add-cart:hover {
    background: var(--shop-price);
    color: #fff;
}

.btn-buy-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--shop-secondary);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-buy-now:hover {
    background: #1d4ed8;
    color: #fff;
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f87171;
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
}

.btn-submit:hover {
    background: #ef4444;
    color: #fff;
}

.btn-primary {
    background: var(--shop-primary);
    border-color: var(--shop-primary);
}

.btn-primary:hover {
    background: var(--shop-primary-dark);
    border-color: var(--shop-primary-dark);
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 1100;
}

/* ========== Utility Classes ========== */
.text-price {
    color: var(--shop-price);
}

.text-primary {
    color: var(--shop-primary) !important;
}

.bg-price-light {
    background: #fef2f2;
}

.bg-primary-light {
    background: rgba(5, 150, 105, 0.1);
}

/* ========== Form Styles ========== */
.form-control:focus,
.form-select:focus {
    border-color: var(--shop-primary);
    box-shadow: 0 0 0 0.2rem rgba(5, 150, 105, 0.15);
}

.form-check-input:checked {
    background-color: var(--shop-primary);
    border-color: var(--shop-primary);
}

/* ========== Loading States ========== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ========== Swiper Customization ========== */
.swiper-pagination-bullet-active {
    background: var(--shop-primary);
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--shop-primary);
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .footer-links {
        gap: 1rem;
    }

    .footer-info-row {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Toast animation (formerly injected at runtime). */

        @keyframes cartBounce {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.3); }
        }
        .cart-bounce {
            animation: cartBounce 0.5s ease;
        }
