/* Freshfind – Brand & variables */
:root {
    --primary: #ff6b00;
    --primary-dark: #e55f00;
    --dark: #000000;
    --light-bg: #f8f9fa;
    --font-body: 'Montserrat', sans-serif;
    --font-heading: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.lead,
.navbar-brand, .navbar-brand-text, .nav-link, .navbar-search-form,
.btn, .card-title, .breadcrumb,
.alert, .form-label, .form-control,
.pagination,
.offer-banner-title, .offer-banner-subtitle, .offer-banner-discount {
    font-family: var(--font-heading);
}

/* Fixed navbar: prevent content from hiding under it */
.body-with-fixed-nav {
    padding-top: 56px;
}
@media (min-width: 992px) {
    .body-with-fixed-nav {
        padding-top: 60px;
    }
}
.main-with-fixed-nav {
    padding-top: 0.5rem;
}

/* ===== Professional Bootstrap 5 Navbar ===== */
#mainNavbar {
    background-color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#mainNavbar .navbar-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

/* Logo: Jumia-style visibility – clearly visible without straining */
.navbar-logo {
    height: 52px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
}

@media (min-width: 992px) {
    .navbar-logo {
        height: 58px;
        max-width: 260px;
    }
}

.navbar-brand {
    margin-right: 0.5rem;
}

.navbar-brand-text {
    color: var(--primary) !important;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (min-width: 992px) {
    .navbar-brand-text {
        font-size: 1.5rem;
    }
}

/* Desktop (lg): even spacing – logo | centered search (bigger) | links */
@media (min-width: 992px) {
    #mainNavbar .navbar-collapse {
        display: flex !important;
        flex: 1 1 auto;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .navbar-search-wrap {
        flex: 1 1 auto;
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .navbar-search-form {
        width: 100%;
        max-width: 420px;
    }

    .navbar-search-form .form-control {
        min-width: 0;
    }

    .navbar-links {
        flex-shrink: 0;
        margin-left: 0;
    }
}

/* Search bar: bigger and consistent */
.navbar-search-form .form-control {
    font-size: 0.95rem;
    padding: 0.4rem 0.75rem;
}

.navbar-search-form .btn-search {
    white-space: nowrap;
}

#mainNavbar .nav-link {
    color: var(--dark) !important;
    font-weight: 500;
}

#mainNavbar .nav-link:hover {
    color: var(--primary) !important;
}

#mainNavbar .badge {
    background-color: var(--primary) !important;
    font-size: 0.7rem;
}

/* Mobile / small: full-width search, then links */
@media (max-width: 991.98px) {
    #mainNavbar .navbar-collapse {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    .navbar-search-wrap {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .navbar-search-form {
        width: 100%;
    }

    .navbar-search-form .form-control {
        flex: 1;
        min-width: 0;
    }

    #mainNavbar .nav-link {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

.deeeliver-brand {
    color: var(--primary) !important;
    font-size: 1.5rem;
}

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

.deeeliver-btn:hover,
.btn-primary:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: var(--dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 0, 0.3);
}

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

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Hero section */
.hero-section {
    background-color: var(--light-bg);
    min-height: 320px;
}

.hero-section .display-4 {
    color: var(--dark);
}

.hero-section .lead {
    color: #495057;
}

/* Cards */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

/* Product list: cards slide up into view with stagger */
.product-list .product-card {
    opacity: 0;
    animation: productSlideUp 0.5s ease-out forwards;
}
.product-list .product-card:nth-child(1) { animation-delay: 0.05s; }
.product-list .product-card:nth-child(2) { animation-delay: 0.1s; }
.product-list .product-card:nth-child(3) { animation-delay: 0.15s; }
.product-list .product-card:nth-child(4) { animation-delay: 0.2s; }
.product-list .product-card:nth-child(5) { animation-delay: 0.25s; }
.product-list .product-card:nth-child(6) { animation-delay: 0.3s; }
.product-list .product-card:nth-child(7) { animation-delay: 0.35s; }
.product-list .product-card:nth-child(8) { animation-delay: 0.4s; }
.product-list .product-card:nth-child(9) { animation-delay: 0.45s; }
.product-list .product-card:nth-child(10) { animation-delay: 0.5s; }
.product-list .product-card:nth-child(11) { animation-delay: 0.55s; }
.product-list .product-card:nth-child(12) { animation-delay: 0.6s; }
@keyframes productSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card .card-title a:hover {
    color: var(--primary) !important;
}

/* Icons on homepage */
.deeeliver-icon {
    font-size: 2rem;
    color: var(--primary);
}

/* Footer */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* Breadcrumbs */
.breadcrumb-item a {
    color: var(--primary);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Alerts – success with primary tint */
.alert-success {
    border-left: 4px solid var(--primary);
}

/* Spacing & layout */
main {
    min-height: calc(100vh - 200px);
}

/* ========== RESPONSIVE: Very small & very large screens ========== */

/* Prevent horizontal scroll and limit width on all devices */
html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Container: comfortable padding on very small screens */
.container, .container-fluid {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

/* Very small screens (up to 375px) */
@media (max-width: 375px) {
    .body-with-fixed-nav {
        padding-top: 52px;
    }

    main {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .navbar-brand-text {
        font-size: 1.15rem;
    }

    .navbar-logo {
        height: 46px;
        max-width: 160px;
    }

    .hero-section .display-4 {
        font-size: 1.75rem;
    }

    .hero-section .lead {
        font-size: 0.95rem;
    }

    .offer-banner-section,
    .offer-banner-section .carousel,
    .offer-banner-section .carousel-inner,
    .offer-banner-section .carousel-item {
        height: 200px;
    }

    .offer-banner-designed-img {
        height: 200px;
    }

    .offer-banner-section .container {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .offer-banner-title.display-5 {
        font-size: 1.25rem;
    }

    .offer-banner-subtitle.lead {
        font-size: 0.9rem;
    }

    .deeeliver-notice {
        font-size: 0.8rem;
        padding: 0.5rem 0.25rem;
    }

    .whatsapp-float {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }

    .btn, .nav-link {
        min-height: 44px; /* touch target */
    }

    .product-card .card-img-top {
        height: 140px !important;
    }

    .product-gallery-main img,
    .product-detail-main-img {
        height: 250px !important;
        max-height: 50vh;
    }

    .product-gallery-thumb {
        width: 56px !important;
        height: 56px !important;
    }

    .footer .row {
        text-align: center;
    }

    .footer .text-md-end {
        text-align: center !important;
    }

    .footer a {
        display: inline-block;
        margin: 0.25rem 0.5rem;
    }
}

/* Small screens (376px – 576px) */
@media (min-width: 376px) and (max-width: 576px) {
    .offer-banner-section,
    .offer-banner-section .carousel,
    .offer-banner-section .carousel-inner,
    .offer-banner-section .carousel-item {
        height: 220px;
    }

    .offer-banner-designed-img {
        height: 220px;
    }

    .product-card .card-img-top {
        height: 160px !important;
    }
}

/* Large screens (1200px+): constrain content width for readability */
@media (min-width: 1200px) {
    .container {
        max-width: 1320px;
    }
}

/* Extra large screens (1600px+): optional max width for very wide displays */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }

    .hero-section {
        min-height: 380px;
    }

    .offer-banner-section,
    .offer-banner-section .carousel,
    .offer-banner-section .carousel-inner,
    .offer-banner-section .carousel-item {
        height: 320px;
    }

    .offer-banner-designed-link,
    .offer-banner-designed-img {
        height: 320px;
    }
}

/* Product cards: responsive image heights */
@media (max-width: 575.98px) {
    .product-list .card-img-top,
    .product-card .card-img-top {
        height: 150px !important;
    }

    .product-card .card-title {
        font-size: 0.9rem;
    }

    .product-card .card-text {
        font-size: 0.85rem;
    }

    .product-card .btn {
        font-size: 0.8rem;
    }

    .d-flex.gap-1.flex-wrap .btn {
        min-height: 40px;
    }
}

/* Very narrow (e.g. 320px): single column product grid for readability */
@media (max-width: 360px) {
    .product-list .col-6,
    .product-list .col-md-4,
    .trending-products .col-6,
    .trending-products .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .related-products .col-6,
    .related-products .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Product detail: stack and scale on small */
@media (max-width: 767.98px) {
    .product-detail-main-img,
    .product-gallery-main img#productMainImage {
        height: 280px !important;
        max-height: 55vh;
    }

    .product-gallery-thumbs {
        gap: 0.5rem;
    }

    .product-gallery-thumb {
        width: 60px !important;
        height: 60px !important;
    }

    .product-detail form.d-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .product-detail form .form-control[type="number"] {
        width: 100%;
        max-width: 100px;
    }
}

/* Cart table: compact on small screens */
@media (max-width: 767.98px) {
    .table-responsive {
        font-size: 0.9rem;
    }

    .table th, .table td {
        padding: 0.5rem;
    }

    .table .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    .table input.form-control-sm {
        max-width: 60px;
    }
}

/* Alerts and messages: full width on small */
@media (max-width: 575.98px) {
    .container.mt-3 .alert {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
    }
}

/* Pagination: wrap on very small */
.pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Breadcrumbs: prevent long text overflow */
.breadcrumb {
    flex-wrap: wrap;
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .breadcrumb {
        font-size: 0.8rem;
    }
}

/* Pagination */
.pagination .page-link {
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.pagination .page-link:hover {
    color: var(--primary-dark);
    background-color: rgba(255, 107, 0, 0.1);
}

/* Homepage notice: orange background, white bold text */
.deeeliver-notice {
    background-color: var(--primary);
    color: #fff;
    font-weight: bold;
}

/* Offer banner: fixed dimensions for all banners (custom + pre-designed) */
.offer-banner-section {
    height: 280px;
    margin-top: 0;
    overflow: hidden;
}
.offer-banner-section .carousel,
.offer-banner-section .carousel-inner,
.offer-banner-section .carousel-item {
    height: 280px;
}
.offer-banner-section .carousel-item {
    position: relative;
}
.offer-banner-designed-link {
    display: block;
    line-height: 0;
    height: 100%;
}
.offer-banner-designed-img {
    height: 280px;
    width: 100%;
    object-fit: cover;
    object-position: center;
}
.offer-banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.offer-banner-bg-default {
    background-color: var(--dark);
}
.offer-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.offer-banner-title,
.offer-banner-subtitle,
.offer-banner-discount {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.offer-banner-discount {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}
.offer-banner-cta {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.offer-banner-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
}

/* Related product cards: subtle hover scale */
.related-product-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.related-product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}
.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}
.product-badge-new {
    background-color: var(--primary);
    color: #fff;
}
.product-badge-sale {
    background-color: #dc3545;
    color: #fff;
}

/* Product gallery thumbnails */
.product-gallery-thumb {
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.product-gallery-thumb:hover,
.product-gallery-thumb.active {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary);
}
.product-gallery-thumb:focus {
    outline: none;
}

/* Fixed WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5);
    z-index: 999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-float:hover {
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}
.whatsapp-float svg {
    flex-shrink: 0;
}

/* Inline WhatsApp button (e.g. on product detail) */
.btn-whatsapp {
    background-color: #25d366;
    border-color: #25d366;
    color: #fff;
}
.btn-whatsapp:hover {
    background-color: #20bd5a;
    border-color: #20bd5a;
    color: #fff;
}
