/********** Template CSS **********/
:root {
    --primary: #f4b400;
    --secondary: #545454;
    --light: #FDF5EB;
    --dark: #4d2c12;
}

/* Disable text selection site-wide */
html, body, * {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

h4,
h5,
h6,
.h4,
.h5,
.h6 {
    font-weight: 600 !important;
}

.py-6 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.my-6 {
    margin-top: 6rem;
    margin-bottom: 6rem;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}


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

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


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

.btn.btn-primary {
    color: #FFFFFF;
}

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

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

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

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


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

.navbar .navbar-nav .nav-link {
    padding: 35px 15px;
    color: var(--light);
    outline: none;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

.navbar.fixed-top {
    transition: .5s;
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        margin-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, .3);
        background: var(--dark);
    }

    .navbar .navbar-nav .nav-link {
        padding: 10px 0;
    }
}

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

    .navbar .nav-item:hover .dropdown-menu {
        transform: rotateX(0deg);
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}


/*** Header ***/
.header-carousel .owl-carousel-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, .5);
}

@media (max-width: 768px) {
    .header-carousel .owl-carousel-item {
        position: relative;
        min-height: 600px;
    }

    .header-carousel .owl-carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .header-carousel .owl-carousel-item p {
        font-size: 16px !important;
    }
}

.header-carousel .owl-nav {
    position: relative;
    width: 80px;
    height: 80px;
    margin: -40px auto 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-carousel .owl-nav::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: #FFFFFF;
    transform: rotate(45deg);
}

.header-carousel .owl-nav .owl-prev,
.header-carousel .owl-nav .owl-next {
    position: relative;
    font-size: 40px;
    color: var(--primary);
    transition: .5s;
    z-index: 1;
}

.header-carousel .owl-nav .owl-prev:hover,
.header-carousel .owl-nav .owl-next:hover {
    color: var(--dark);
}

.page-header {
    margin-bottom: 6rem;
    background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)), url(/img/hero-egg-tart.jpg) center center no-repeat;
    background-size: cover;
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--light);
}


/*** Facts ***/
.fact-item {
    transition: .5s;
}

.fact-item:hover {
    margin-top: -10px;
    background: #FFFFFF !important;
    box-shadow: 0 0 45px rgba(0, 0, 0, .07);
}


/*** About ***/
.img-twice::before {
    position: absolute;
    content: "";
    width: 60%;
    height: 80%;
    top: 10%;
    left: 20%;
    background: var(--primary);
    border: 25px solid var(--light);
    border-radius: 6px;
    z-index: -1;
}


/*** Product ***/
.product-item {
    transition: .5s;
}

.product-item:hover {
    background: var(--primary) !important;
}

.product-item:hover * {
    color: var(--light);
}

.product-item:hover .border-primary {
    border-color: var(--light) !important;
}

/* Ensure consistent product image sizing */
.product-item .position-relative {
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-item .position-relative img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Ensure product images maintain aspect ratio and consistent sizing on mobile */
@media (max-width: 768px) {
    .product-item .position-relative {
        height: 250px;
    }
}

.product-item .product-overlay {
    position: absolute;
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    overflow: hidden;
    opacity: 0;
    transition: .5s;
}

.product-item:hover .product-overlay {
    height: 100%;
    opacity: 1;
}


/*** Team ***/
.team-item .team-text {
    position: relative;
    height: 100px;
    overflow: hidden;
}

.team-item .team-title {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--light);
    transition: .5s;
}

.team-item:hover .team-title {
    top: -100px;
}

.team-item .team-social {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 100px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    transition: .5s;
}

.team-item .team-social .btn {
    margin: 0 3px;
}

.team-item:hover .team-social {
    top: 0;
}


/*** Testimonial ***/
.testimonial-carousel .owl-item .testimonial-item img {
    width: 60px;
    height: 60px;
}

.testimonial-carousel .owl-item .testimonial-item,
.testimonial-carousel .owl-item .testimonial-item * {
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-item {
    background: var(--primary) !important;
}

.testimonial-carousel .owl-item.center .testimonial-item * {
    color: #FFFFFF !important;
}

.testimonial-carousel .owl-nav {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    margin: 0 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    font-size: 22px;
    color: var(--light);
    background: var(--primary);
    transition: .5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    color: var(--primary);
    background: var(--dark);
}


/*** Footer ***/
.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: var(--light);
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--light);
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--primary);
    letter-spacing: 1px;
    box-shadow: none;
}

.copyright {
    background: #111111;
}

.copyright a {
    color: var(--primary);
}

.copyright a:hover {
    color: var(--light);
}

/* Cart indicator on nav cart icon */
.cart-link { position: relative; }
.cart-link.cart-has-items::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
}

/* --- Mobile tweaks --- */
@media (max-width: 576.98px) {
    /* Reduce giant display headings on phones */
    .display-1 { font-size: 2.25rem; }
    .display-4 { font-size: 1.75rem; }
    .navbar .navbar-brand h1 { font-size: 1.35rem; }

    /* Tighten global section spacing */
    .py-6 { padding-top: 3rem; padding-bottom: 3rem; }
    .my-6 { margin-top: 3rem; margin-bottom: 3rem; }
    .page-header { margin-bottom: 3rem; }

    /* Constrain header carousel height and text sizes */
    .header-carousel .owl-carousel-item { min-height: 420px; }
    .header-carousel .owl-carousel-item p { font-size: 14px !important; }

    /* Make cart controls readable and tappable */
    #cart-container .input-group.input-group-sm { max-width: 180px; }
    #cart-container .input-group.input-group-sm .btn { min-width: 36px; }
    #cart-container .input-group.input-group-sm .form-control {
        min-width: 64px;
        padding-left: .25rem;
        padding-right: .25rem;
        font-size: 16px;
        line-height: 1.2;
        color: #000;
        background: #fff;
    }
    #cart-container .btn.btn-sm { padding: .35rem .55rem; }

    /* Override large inline margins used on some sections */
    .container-xxl[style*="margin: 12rem 0"] { margin: 3rem 0 !important; }
    .container-xxl[style*="margin-top: 8rem"] { margin-top: 5rem !important; }

    /* Newsletter form mobile improvements */
    .bg-primary.text-light.rounded-top { padding: 2rem 1.5rem !important; }
    .bg-primary .display-4 { 
        font-size: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }
    .bg-primary .row { margin: 0; }
    .bg-primary .col-md-6 { padding: 0; }
    
    /* Newsletter form - stack on mobile */
    #newsletter-form-index,
    #newsletter-form-testimonial {
        position: relative !important;
        margin-top: 1rem;
    }
    
    #newsletter-form-index input[type="email"],
    #newsletter-form-testimonial input[type="email"] {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 16px !important;
        margin-bottom: 0.5rem;
    }
    
    #newsletter-form-index button[type="submit"],
    #newsletter-form-testimonial button[type="submit"] {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin: 0.5rem 0 !important;
        width: 100%;
        padding: 0.75rem 1rem !important;
    }
    
    /* Turnstile widget mobile - center and scale down if needed */
    .cf-turnstile {
        margin-top: 1rem !important;
        display: flex;
        justify-content: center;
        transform-origin: center;
    }
    
    /* Scale down Turnstile if screen is too small */
    @media (max-width: 360px) {
        .cf-turnstile {
            transform: scale(0.85);
        }
    }

    /* Product cards - ensure proper spacing */
    .product-item {
        margin-bottom: 2rem !important;
    }

    /* Testimonial cards */
    .testimonial-item {
        margin-bottom: 2rem !important;
    }

    /* Team member cards */
    .team-item {
        margin-bottom: 2rem !important;
    }

    /* Footer - improve spacing */
    .footer .col-lg-3,
    .footer .col-md-6 {
        margin-bottom: 2rem !important;
    }

    /* Contact page - stack properly */
    .contact-form .col-md-6 {
        margin-bottom: 1rem;
    }

    /* About page images */
    .about-img img {
        margin-bottom: 1.5rem;
    }

    /* Service cards */
    .service-item {
        margin-bottom: 2rem !important;
    }

    /* Back to top button - smaller on mobile */
    .back-to-top {
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
    }

    /* Page header breadcrumb - better mobile layout */
    .page-header {
        padding-top: 3rem !important;
        padding-bottom: 2rem !important;
    }

    .page-header h1 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
    }

    .page-header .breadcrumb {
        font-size: 0.75rem !important;
        justify-content: center !important;
        flex-wrap: wrap;
        margin-bottom: 0;
    }

    /* Breadcrumb items spacing */
    .breadcrumb-item {
        font-size: 0.75rem !important;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 0.25rem !important;
        font-size: 0.75rem !important;
    }

    .breadcrumb-item a,
    .breadcrumb-item.active {
        font-size: 0.75rem !important;
    }
}

/* Slightly lower navbar action icons */
.navbar .flex-shrink-0.btn-lg-square {
    margin-top: 6px;
}

/* Additional mobile enhancements for touch-friendly UI */
@media (max-width: 767.98px) {
    /* Ensure all buttons are touch-friendly (min 44px) */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }

    /* Make all links touch-friendly */
    a:not(.btn) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Navbar adjustments */
    .navbar .navbar-nav .nav-link {
        padding: 1rem 0.75rem;
        font-size: 1rem;
    }

    /* Product grid - 1 column on very small screens */
    .product-item,
    .service-item,
    .team-item {
        max-width: 100%;
    }

    /* Ensure images are responsive */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Table responsive wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Fix iframe responsiveness (Google Maps) */
    iframe {
        max-width: 100%;
    }
}

/* Tablet improvements */
@media (min-width: 577px) and (max-width: 991.98px) {
    /* Newsletter form tablet layout */
    #newsletter-form-index button[type="submit"],
    #newsletter-form-testimonial button[type="submit"] {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        margin-top: 0.5rem !important;
        margin-right: 0.5rem !important;
        width: auto;
    }

    #newsletter-form-index input[type="email"],
    #newsletter-form-testimonial input[type="email"] {
        padding-right: 7rem !important;
    }

    .cf-turnstile {
        margin-top: 1rem !important;
        display: flex;
        justify-content: flex-end;
    }
}