/* Theme color variables (site palette) */
:root {
    --site-primary: #f6402e;
    /* 主色 亮黃 */
    --site-pink: #febc32;
    /* 甜粉 */
    --site-sky: #0055d1;
    /* 天空藍 */
    --site-text-dark: #495057;
    /* 深灰文字 */

    /* map Bootstrap tokens to site palette so site CSS using var(--bs-*) follows palette */
    --bs-primary: var(--site-primary);
    --bs-secondary: var(--site-pink);
    --bs-info: var(--site-sky);
    --bs-dark: var(--site-text-dark);
    /* Top header green requested by user */
    --site-top-green: #81C408;
}

/* Override common Bootstrap classes that use hard-coded green values in bootstrap.min.css */
.bg-primary {
    background-color: var(--site-primary) !important
}

/* Ensure any text placed on the site primary (yellow) background is dark for accessibility */
.bg-primary,
.bg-primary * {
    color: #000 !important;
}

/* Specific common patterns that previously used .text-white on colored backgrounds */
.bg-primary .text-white,
.btn-primary.text-white,
.btn-primary .text-white,
.service .service-item .service-content .text-white,
.fruite .fruite-categorie .fruite-name a.text-white {
    color: #000 !important;
}

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

.link-primary {
    color: var(--site-primary) !important
}

.btn-primary {
    color: #000 !important;
    background-color: var(--site-primary) !important;
    border-color: var(--site-primary) !important
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #ffd94d !important;
    border-color: #ffd14a !important
}

.btn-outline-primary {
    color: var(--site-primary) !important;
    border-color: var(--site-primary) !important
}

.page-item.active .page-link,
.page-link.active {
    background-color: var(--site-primary) !important;
    border-color: var(--site-primary) !important;
    color: #000 !important
}

.page-link:focus {
    box-shadow: 0 0 0 .25rem rgba(255, 224, 102, .25) !important
}

.nav-link {
    color: var(--site-primary) !important
}

/* Make the site title and top navigation use the requested green color */
.navbar .display-6,
.navbar .fa,
.navbar .text-primary,
.navbar .nav-item .nav-link,
.nav-item.nav-link.active,
.navbar .nav-item .nav-link:hover,
.navbar-brand,
.navbar .navbar-brand,
.navbar-toggler,
.navbar-toggler .fa,
.navbar .fa-bars,
.navbar .navbar-nav .nav-link,
.navbar .nav-link {
    color: var(--site-top-green) !important;
}

.link-primary:hover {
    color: #ffd94d !important
}

/* Form controls (checked states) */
.form-check-input:checked {
    background-color: var(--site-primary) !important;
    border-color: var(--site-primary) !important
}

.form-range::-webkit-slider-thumb {
    background-color: var(--site-primary) !important
}

/*** Spinner Start ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .8s ease-out, visibility 0s linear .0s;
    visibility: visible;
    opacity: 1;
}

.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: flex;
    width: 45px;
    height: 45px;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
    z-index: 99;
}

/*** Spinner End ***/


/*** Button Start ***/
.btn {
    font-weight: 600;
    transition: .5s;
}

.btn-square {
    width: 32px;
    height: 32px;
}

.btn-sm-square {
    width: 34px;
    height: 34px;
}

.btn-md-square {
    width: 44px;
    height: 44px;
}

.btn-lg-square {
    width: 56px;
    height: 56px;
}

.btn-square,
.btn-sm-square,
.btn-md-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.btn.border-secondary {
    transition: 0.5s;
}

.btn.border-secondary:hover {
    background: var(--bs-secondary) !important;
    color: var(--bs-white) !important;
}

/*** Topbar Start ***/
.fixed-top {
    transition: 0.5s;
    background: var(--bs-white);
    border: 0;
}

.topbar {
    padding: 20px;
    border-radius: 230px 100px;
}

.topbar .top-info {
    font-size: 15px;
    line-height: 0;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.topbar .top-link {
    font-size: 15px;
    line-height: 0;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.topbar .top-link a {
    letter-spacing: 1px;
}

.topbar .top-link a small:hover {
    color: var(--bs-secondary) !important;
    transition: 0.5s;
}

.topbar .top-link a small:hover i {
    color: var(--bs-primary) !important;
}

/*** Topbar End ***/

/*** Navbar Start ***/
.navbar .navbar-nav .nav-link {
    padding: 10px 15px;
    font-size: 16px;
    transition: .5s;
}

.navbar {
    height: 100px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

/* Accent text color for site headings requested by user */
.text-accent {
    color: var(--site-top-green) !important;
}

/* Footer: make background white and text dark for user's preference */
.container-fluid.footer,
.container-fluid.copyright {
    background-color: #ffffff !important;
    color: var(--site-text-dark) !important;
}

.container-fluid.footer a.btn-link,
.container-fluid.footer .footer-item h4,
.container-fluid.footer p,
.container-fluid.footer a,
.container-fluid.copyright span {
    color: var(--site-text-dark) !important;
}

/* Footer boxed icons (moved from inline partial): white square, light border, subtle shadow */
.footer .icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 40px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 6px;
}

.footer .icon-box img {
    max-height: 28px;
    max-width: 100%;
    object-fit: contain;
}

@media (max-width:767.98px) {
    .footer .icon-box {
        width: 52px;
        height: 36px;
    }
}

/* App download icons: slightly larger boxed variant */
.footer .app-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 44px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 6px 10px;
}

.footer .app-icon-box img {
    max-height: 36px;
    max-width: 100%;
    object-fit: contain;
}

@media (max-width:767.98px) {
    .footer .app-icon-box {
        width: 76px;
        height: 40px;
    }
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active,
.fixed-top.bg-white .navbar .navbar-nav .nav-link:hover,
.fixed-top.bg-white .navbar .navbar-nav .nav-link.active {
    color: var(--bs-primary);
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 700;
    vertical-align: middle;
    margin-left: 8px;
}

@media (min-width: 1200px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        border: 0;
        transition: .5s;
        opacity: 0;
    }
}

.dropdown .dropdown-menu a:hover {
    background: var(--bs-secondary);
    color: var(--bs-primary);
}

.navbar .nav-item:hover .dropdown-menu {
    transform: rotateX(0deg);
    visibility: visible;
    background: var(--bs-light) !important;
    border-radius: 10px !important;
    transition: .5s;
    opacity: 1;
}

#searchModal .modal-content {
    background: rgba(255, 255, 255, .8);
}


/* ==========================
   Header (custom) styles — adapted to screenshot
   Red gradient top area, centered white search, white icons
   ========================== */

/* Topbar: compact red gradient bar */
.topbar {
    padding: 6px 14px;
    border-radius: 0;
    background: transparent;
    /* moved gradient to outer container */
    color: #fff;
}

/* Main header area (logo + search + actions) sits under topbar and shares gradient */
.main-header {
    background: transparent;
    /* moved gradient to outer container */
    z-index: 1020;
    color: #fff;
    border-bottom: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
}

.brand-text {
    font-weight: 700;
    color: #fff;
    font-size: 2.3rem;
    line-height: 1;
}

.logo-stars i {
    color: rgba(255, 255, 255, 0.95);
    margin-left: 2px;
    font-size: 2.3rem;
    line-height: 1;
    display: inline-block;
}

/* Desktop prominent search: white rounded box centered across header area */
.header-search {
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* restore original search box padding for previous look */
    padding: 6px 10px;
    /* make the search area taller so the button appears larger */
    min-height: 56px;
    border-radius: 6px;
    /* 方形，較小圓角 */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.search-input-wrapper .search-icon {
    color: rgba(0, 0, 0, 0.28);
    margin-left: 4px;
}

.search-input {
    border: none;
    outline: none;
    font-size: 16px;
    /* let input vertically center and fill available height */
    padding: 0 8px;
    /* leave space for square button on the right */
    padding-right: 56px;
    color: #333;
    flex: 1 1 auto;
    height: 100%;
    display: flex;
    align-items: center;
}

/* remove focus ring/green outline when clicking the input/button */
.search-input:focus,
.search-input:focus-visible,
.search-btn:focus,
.search-btn:focus-visible,
.search-input-wrapper:focus-within {
    outline: none !important;
    box-shadow: none !important;
}

.search-input::placeholder {
    color: #888;
}

/* Ensure the search button sits inline and keeps rectangular look */
.search-btn {
    background: var(--bs-primary);
    color: #fff;
    border: 0;
    border-radius: 0px;
    width: 60px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    flex: 0 0 auto;
}

/* Use layout-friendly flex alignment for navbar actions on large screens (avoid absolute positioning) */
@media (min-width: 1200px) {
    .main-header .navbar .navbar-nav {
        position: static;
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 12px;
    }


    .main-header .navbar .nav-item {
        margin-top: 0;
    }


    .auth-link-top {
        color: #fff !important;
        font-weight: 600;
        text-decoration: none;
    }

    .auth-link-top:hover {
        color: #ffd9a6 !important;
    }
}

/* small separator between auth links in topbar */
.topbar .sep {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    user-select: none;
}

.search-btn .btn-text {
    margin-left: 6px;
}

.search-btn .btn-text {
    margin-left: 6px;
}

.search-btn .btn-text {
    margin-left: 6px;
}

.popular-keywords {
    text-align: left;
    margin-top: 8px;
    width: 100%;
    max-width: 820px;
    margin-left: 0;
}

.search-categories {
    background: var(--bs-danger);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.search-categories .cat-item {
    color: #fff;
    font-size: 13px;
    opacity: 0.95;
}

.popular-keywords .keyword-tag {
    color: rgba(255, 255, 255, 0.95);
    margin-right: 8px;
    font-size: 13px;
}

/* Right-side icons should be white; cart link is positioned relative so its badge can be absolute */
.cart-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #fff;
    color: var(--site-primary);
    font-weight: 700;
    font-size: 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Search icons — make white in header, mobile button and modal title */
.header-search .fas.fa-search,
.search-input-wrapper .search-icon,
.btn-search-mobile .fas.fa-search,
.modal-title .fas.fa-search,
.search-modal .fas.fa-search {
    color: #fff !important;
}

/* Smaller badge on mobile and slightly different offset to avoid overlapping tap targets */
@media (max-width: 576px) {
    .cart-badge {
        top: -6px;
        right: -6px;
        min-width: 18px;
        height: 18px;
        font-size: 11px;
        padding: 0 4px;
    }
}

/* Mobile: hide desktop search and show mobile button */
@media (max-width:1199.98px) {
    .header-search.d-none.d-xl-block {
        display: none !important;
    }

    .btn-search-mobile {
        background: transparent;
        border: none;
        color: #fff;
    }
}

/* Responsive: smaller search button/input on tablet and mobile */
@media (max-width: 1199.98px) {
    .search-input-wrapper {
        min-height: 56px;
        /* reduce overall height on tablet */
    }

    .search-btn {
        width: 40px;
        height: 40px;
    }

    .search-input {
        padding-right: 48px;
        /* leave space for 40px button + gap */
    }
}

@media (max-width: 767.98px) {
    .search-input-wrapper {
        min-height: 48px;
        /* smaller on phones */
    }

    .search-btn {
        width: 36px;
        height: 36px;
    }

    .search-input {
        padding-right: 44px;
    }
}

/* Mobile modal search visuals */
.mobile-search-container {
    display: flex;
    gap: 8px;
}

.mobile-search-input {
    flex: 1 1 auto;
    border-radius: 40px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-search-btn {
    background: #fff5e6;
    color: #000;
    border: 0;
    padding: 10px 12px;
    border-radius: 40px;
}

/* Push page content down when header is fixed (adjusted for taller gradient header) */
.fixed-top+.container,
.fixed-top+.container-fluid {
    margin-top: 120px;
}

@media (max-width:575.98px) {

    .fixed-top+.container,
    .fixed-top+.container-fluid {
        margin-top: 96px;
    }
}


/*** Navbar End ***/

/*** Hero Header ***/
.hero-header {
    background: linear-gradient(rgba(248, 223, 173, 0.1), rgba(248, 223, 173, 0.1)), url(../img/hero-img.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.carousel-item {
    position: relative;
}

.carousel-item a {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 25px;
    background: linear-gradient(rgba(255, 251, 36, 0.7), rgba(255, 222, 36, 0.7));
}

.carousel-control-next,
.carousel-control-prev {
    width: 48px;
    height: 48px;
    border-radius: 48px;
    border: 1px solid var(--bs-white);
    background: var(--bs-primary);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-control-next {
    margin-right: 20px;
}

.carousel-control-prev {
    margin-left: 20px;
}

.page-header {
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url(../img/cart-page-header-img.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

@media (min-width: 992px) {

    .hero-header,
    .page-header {
        margin-top: 152px !important;
    }
}

@media (max-width: 992px) {

    .hero-header,
    .page-header {
        margin-top: 97px !important;
    }
}

/*** Hero Header end ***/


/*** featurs Start ***/
.featurs .featurs-item .featurs-icon {
    position: relative;
    width: 120px;
    height: 120px;
}

.featurs .featurs-item .featurs-icon::after {
    content: "";
    width: 35px;
    height: 35px;
    background: var(--bs-secondary);
    position: absolute;
    bottom: -10px;
    transform: translate(-50%);
    transform: rotate(45deg);
    background: var(--bs-secondary);

}

/*** featurs End ***/

/* Fruits shop: make product cards consistent height */
.fruite .fruite-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fruite .fruite-img {
    height: 190px;
    /* fixed image area */
    overflow: hidden;
}

.fruite .fruite-img img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.fruite .fruite-item>.p-4 {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.fruite .fruite-item .d-flex.justify-content-between {
    margin-top: auto;
    /* push price & button to bottom */
}

@media (max-width: 767.98px) {
    .fruite .fruite-img {
        height: 150px;
    }
}

@media (min-width: 992px) {
    .fruite .fruite-img {
        height: 200px;
    }
}

/* Vesitable (蔬菜區) — 等高卡片，圖片固定高度，內容區置底 */
.vesitable .vesitable-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vesitable .vesitable-img {
    height: 190px;
    overflow: hidden;
}

.vesitable .vesitable-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vesitable .vesitable-item>.p-4 {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.vesitable .vesitable-item .d-flex.justify-content-between {
    margin-top: auto;
}

@media (max-width: 991.98px) {
    .vesitable .vesitable-img {
        height: 160px;
    }
}

@media (max-width: 575.98px) {
    .vesitable .vesitable-img {
        height: 120px;
    }

    .vesitable .vesitable-item .d-flex.justify-content-between {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* Responsive header tweaks (mobile / tablet) */
@media (max-width: 1199.98px) {

    /* hide desktop-wide search on smaller than XL (fallback) */
    .header-search.d-none.d-xl-block {
        display: none !important;
    }

    /* make navbar height smaller on tablet */
    .navbar {
        height: 70px;
    }

    /* shrink logo text size for better fit */
    .navbar-brand .h5,
    .navbar-brand h1,
    .navbar-brand h3 {
        font-size: 1rem;
        line-height: 1;
        margin-bottom: 0;
    }

    /* make the navbar padding tighter */
    .container.px-0.py-2 {
        padding-top: .25rem !important;
        padding-bottom: .25rem !important;
    }

    /* cart badge: smaller and easier to tap */
    .nav-link .rounded-circle {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.75rem !important;
        top: -4px !important;
        right: -4px !important;
    }
}

@media (max-width: 767.98px) {

    /* On phones: show search icon (already present), and ensure modal input is full width */
    .navbar {
        height: auto;
    }

    /* ensure small-screen search button is visible and prominent */
    .btn-search {
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    /* modal search - make input padding comfortable on phones */
    #searchModal .modal-body .form-control,
    #searchModal .modal-body .input-group .form-control,
    #searchModal .modal-body input[type="search"] {
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    /* modal input group width full on phones */
    #searchModal .modal-body .w-75 {
        width: 95% !important;
    }

    /* reduce topbar height on phones */
    .topbar.d-none.d-lg-block {
        display: none !important;
    }
}

/* Minor visual polish for header elements */
.popular-keywords a {
    color: var(--site-text-dark);
    text-decoration: none;
}

.popular-keywords a:hover {
    text-decoration: underline;

    /* On XL desktop, offset the popular keywords to match the input text start (icon + gap + padding) */
    @media (min-width: 1200px) {
        .header-search .search-container {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        /* approximate offset: wrapper padding-left + icon width + gap */
        .header-search .popular-keywords {
            margin-left: 40px;
            /* tweak this value if needed */
        }
    }
}

/* Header color override requested: set header background to #f6402e and ensure contrast */
.container-fluid.fixed-top {
    background: linear-gradient(90deg, #ff5a3c 0%, #ff3b30 50%, #ff7043 100%);
}

/* Topbar/link colors on the red background */
.container-fluid.fixed-top a,
.container-fluid.fixed-top .top-info,
.container-fluid.fixed-top .top-link,
.container-fluid.fixed-top .navbar-brand,
.container-fluid.fixed-top .nav-link,
.container-fluid.fixed-top .navbar-toggler .fa,
.container-fluid.fixed-top .fa {
    color: #ffffff !important;
}

/* Make sure navbar links are visible (lighter hover state) */
.container-fluid.fixed-top .navbar .nav-link:hover {
    color: #ffd9a6 !important;
}

/* Cart badge on red header: use white background for badge for readability */
.container-fluid.fixed-top .nav-link .rounded-circle {
    background: #ffffff !important;
    color: #f6402e !important;
    font-weight: 600;
}

/*** service Start ***/
.service .service-item .service-content {
    position: relative;
    width: 250px;
    height: 130px;
    top: -50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/*** service End ***/


/*** Fruits Start ***/
.fruite .tab-class .nav-item a.active {
    background: var(--bs-secondary) !important;
}

.fruite .tab-class .nav-item a.active span {
    color: var(--bs-white) !important;
}

.fruite .fruite-categorie .fruite-name {
    line-height: 40px;
}

.fruite .fruite-categorie .fruite-name a {
    transition: 0.5s;
}

.fruite .fruite-categorie .fruite-name a:hover {
    color: var(--bs-secondary);
}

.fruite .fruite-item {
    height: 100%;
    transition: 0.5s;
}

.fruite .fruite-item:hover {
    box-shadow: 0 0 55px rgba(0, 0, 0, 0.4);
}

.fruite .fruite-item .fruite-img {
    overflow: hidden;
    transition: 0.5s;
    border-radius: 10px 10px 0 0;
}

.fruite .fruite-item .fruite-img img {
    transition: 0.5s;
}

.fruite .fruite-item .fruite-img img:hover {
    transform: scale(1.3);
}

/*** Fruits End ***/


/*** vesitable Start ***/
.vesitable .vesitable-item {
    height: 100%;
    transition: 0.5s;
}

.vesitable .vesitable-item:hover {
    box-shadow: 0 0 55px rgba(0, 0, 0, 0.4);
}

.vesitable .vesitable-item .vesitable-img {
    overflow: hidden;
    transition: 0.5s;
    border-radius: 10px 10px 0 0;
}

.vesitable .vesitable-item .vesitable-img img {
    transition: 0.5s;
}

.vesitable .vesitable-item .vesitable-img img:hover {
    transform: scale(1.3);
}

/*** vesitable End ***/