/* ============================================
   MyFlower - Front-end Styles
   ============================================ */

:root {
    --primary: #e91e63;
    --primary-dark: #c2185b;
    --primary-light: #fce4ec;
    --secondary: #ff6b6b;
    --dark: #2d3436;
    --gray: #636e72;
    --light-bg: #f8f9fa;
    --border: #eee;
}

/* --- Wider Container Override --- */
@media (min-width: 1200px) {
    .container { max-width: 1400px; }
}
@media (min-width: 1600px) {
    .container { max-width: 1540px; }
}

/* --- Base --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--dark);
    padding-bottom: 0;
}
@media (max-width: 991px) {
    body { padding-bottom: 60px; }
}

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

/* --- Announcement Bar --- */
.announcement-bar {
    font-size: 13px;
    letter-spacing: 0.5px;
}
.announcement-bar a:hover { opacity: 0.9; }

/* --- Header --- */
.site-header {
    z-index: 1030;
    border-bottom: 1px solid var(--border);
}
.site-header .navbar-brand { font-size: 1.5rem; }
.site-header .nav-link { font-size: 0.9rem; font-weight: 500; color: var(--dark) !important; }
.site-header .nav-link:hover { color: var(--primary) !important; }

/* Mega Menu */
.dropdown-menu-lg { border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.1); }
.dropdown-header { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- Product Card --- */
.product-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.product-card .card-img-wrap {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: var(--light-bg);
}
.product-card .card-img-wrap img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.05); }
.product-card .badges {
    position: absolute;
    top: 10px; left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.product-card .badge-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.badge-bestseller { background: var(--secondary); color: #fff; }
.badge-new { background: #4caf50; color: #fff; }
.badge-sale { background: #ff9800; color: #fff; }
.badge-sameday { background: var(--primary); color: #fff; }

.product-card .card-body {
    padding: 12px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card .product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .product-subtitle {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 8px;
}
.product-card .product-price {
    margin-top: auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}
.product-card .product-price .original-price {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
    margin-left: 6px;
}

/* --- Hero Section --- */
.hero-swiper {
    overflow: hidden;
    width: 100%;
    position: relative;
}

/* Hero Category Nav (PC only, overlay on banner) */
.hero-category-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: transparent;
    transition: background-color 0.3s ease;
}
.hero-category-nav:hover {
    background-color: #fff;
}
.hero-category-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
}
.hero-nav-item {
    position: relative;
}
.hero-nav-item > a {
    display: block;
    padding: 20px 24px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    white-space: nowrap;
}
.hero-category-nav:hover .hero-nav-item > a {
    color: var(--dark);
    text-shadow: none;
}
.hero-category-nav:hover .hero-nav-item:hover > a {
    color: var(--primary);
}
/* Underline indicator on hover */
.hero-category-nav:hover .hero-nav-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s ease, left 0.2s ease;
}
.hero-category-nav:hover .hero-nav-item:hover > a::after {
    width: 60%;
    left: 20%;
}

/* --- Dropdown (shared) --- */
.hero-nav-dropdown {
    position: absolute;
    top: 100%;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 20;
}
.hero-nav-item:hover > .hero-nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Simple dropdown (just links) --- */
.hero-nav-simple {
    left: 0;
    min-width: 200px;
    border-radius: 0 0 8px 8px;
    padding: 8px 0;
}
.hero-nav-dropdown-link {
    display: block;
    padding: 10px 24px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.hero-nav-dropdown-link:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* --- Mega dropdown (columns with titles) --- */
.hero-nav-mega {
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 600px;
    max-width: 1000px;
    border-radius: 0 0 8px 8px;
    padding: 24px 32px;
}
.hero-nav-item:hover > .hero-nav-mega {
    transform: translateX(-50%) translateY(0);
}
.hero-nav-mega-inner {
    display: flex;
    gap: 32px;
}
.hero-nav-mega-col {
    min-width: 120px;
}
.hero-nav-mega-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.hero-nav-mega-title a {
    color: var(--dark);
    text-decoration: none;
}
.hero-nav-mega-title a:hover {
    color: var(--primary);
}
.hero-nav-mega-link {
    display: block;
    padding: 5px 0;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.15s ease;
}
.hero-nav-mega-link:hover {
    color: var(--primary);
}

@media (min-width: 992px) and (max-width: 1199px) {
    .hero-nav-item > a {
        padding: 18px 16px;
        font-size: 0.88rem;
    }
    .hero-nav-mega {
        min-width: 500px;
        padding: 20px 24px;
    }
    .hero-nav-mega-inner {
        gap: 20px;
    }
}
.hero-swiper .swiper-slide {
    height: 75vh;
    min-height: 500px;
    max-height: 750px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}
@media (max-width: 767px) {
    .hero-swiper .swiper-slide { height: 50vh; min-height: 300px; }
}
.hero-content {
    padding: 0 0 60px;
    max-width: 600px;
}
.hero-content h2 { font-size: 2.5rem; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.hero-content p { font-size: 1.1rem; color: rgba(255,255,255,.95); text-shadow: 0 1px 4px rgba(0,0,0,.3); }
@media (max-width: 767px) {
    .hero-content { padding: 0 0 30px; }
    .hero-content h2 { font-size: 1.5rem; }
}

/* --- Section Titles --- */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- Category Cards --- */
.category-card {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background: var(--light-bg);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--dark);
    display: block;
}
.category-card:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    color: var(--primary);
}
.category-card i { font-size: 2rem; margin-bottom: 8px; color: var(--primary); display: block; }

/* --- Occasion Circle Cards (bloomthis style) --- */
.occasion-section { padding: 30px 0 20px; overflow: clip; }
.occasionSwiper { overflow: visible; }

.occasion-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
    transition: transform 0.3s ease;
}
.occasion-item:hover {
    transform: translateY(-4px);
    color: var(--primary);
}

.occasion-img-wrap {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--light-bg);
    border: 3px solid var(--border);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 10px;
}
.occasion-item:hover .occasion-img-wrap {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
}

.occasion-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.occasion-item:hover .occasion-img-wrap img {
    transform: scale(1.08);
}

.occasion-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), #f8f9fa);
}
.occasion-placeholder i {
    font-size: 2rem;
    color: var(--primary);
}

.occasion-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    max-width: 120px;
}

.occasionSwiper .swiper-button-prev,
.occasionSwiper .swiper-button-next { display: none; }

@media (max-width: 575px) {
    .occasion-img-wrap { width: 80px; height: 80px; border-width: 2px; }
    .occasion-name { font-size: 0.75rem; max-width: 80px; }
}
@media (min-width: 576px) and (max-width: 767px) {
    .occasion-img-wrap { width: 100px; height: 100px; }
    .occasion-name { font-size: 0.8rem; max-width: 100px; }
}
@media (min-width: 1200px) {
    .occasion-img-wrap { width: 140px; height: 140px; }
    .occasion-name { font-size: 0.9rem; max-width: 140px; }
}

/* --- WhatsApp Float --- */
.whatsapp-float {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(37,211,102,.4);
    z-index: 1000;
    text-decoration: none;
    transition: transform 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); color: #fff; }
@media (min-width: 992px) { .whatsapp-float { bottom: 30px; } }

/* --- Mobile Bottom Bar --- */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 1040;
    padding: 4px 0;
}
.mobile-bottom-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--gray);
    padding: 6px 0;
    font-size: 11px;
    position: relative;
}
.mobile-bottom-item i { display: block; font-size: 18px; margin-bottom: 2px; }
.mobile-bottom-item.active { color: var(--primary); }
.cart-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(14px);
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
}

/* --- Footer --- */
.site-footer a:hover { color: var(--primary) !important; }

/* --- Buttons --- */
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); }
.text-primary { color: var(--primary) !important; }

/* --- Responsive Grid --- */
@media (max-width: 575px) {
    .product-grid .col { flex: 0 0 50%; max-width: 50%; }
    .product-card .product-name { font-size: 0.85rem; }
    .product-card .product-price { font-size: 0.95rem; }
}

/* --- Pagination --- */
.pagination { justify-content: center; margin: 30px 0; }
.pagination .page-link {
    color: var(--dark);
    border-color: var(--border);
    border-radius: 8px !important;
    margin: 0 3px;
    padding: 8px 14px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-link:hover { color: var(--primary); border-color: var(--primary); }
.pagination .page-item.disabled .page-link { color: #ccc; }

/* --- Product Detail Page --- */
@media (min-width: 992px) {
    .product-detail-page { max-width: 85%; }
    .product-detail-row { --bs-gutter-x: 50px; }
}
.product-gallery {
    display: flex;
    gap: 50px;
}
.product-thumbs-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    max-height: 460px;
    overflow-y: auto;
}
.product-thumbs-vertical::-webkit-scrollbar { width: 3px; }
.product-thumbs-vertical::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.product-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
    flex-shrink: 0;
}
.product-thumb:hover { border-color: var(--gray); }
.product-thumb.active { border-color: var(--primary); }
.product-main-image-wrap {
    position: relative;
    flex: 1;
    padding-top: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: var(--light-bg);
}
.product-main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 移动端 */
@media (max-width: 991px) {
    .product-detail-page { max-width: 100%; }
    .product-gallery { gap: 12px; }
}
@media (max-width: 575px) {
    .product-buy-btn { width: 100% !important; }
}

/* Mobile gallery swiper */
.gallerySwiper { border-radius: 12px; overflow: hidden; }
.gallerySwiper .product-main-image-wrap { border-radius: 0; }

/* Mobile thumb strip */
.mobile-thumbs-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.mobile-thumbs-row::-webkit-scrollbar { display: none; }
.mobile-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s;
}
.mobile-thumb:hover { border-color: var(--gray); }
.mobile-thumb.active { border-color: var(--primary); }

.product-description {
    border-top: 1px solid var(--border);
    padding-top: 15px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Reviews */
.product-reviews-section { max-width: 800px; }
.review-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.review-item:last-child { border-bottom: none; }

/* Store option & saved address option */
.store-option, .saved-address-option { transition: border-color 0.2s; }
.store-option:hover, .saved-address-option:hover { border-color: var(--primary) !important; }
.store-option.selected, .saved-address-option.selected { border-width: 2px !important; border-color: var(--primary) !important; background: var(--primary-light); }
