@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #fefce8;
    color: #212529;
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #ff6900;
    outline-offset: 2px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}


   /* General */

.text-orange {
    color: #ff6900 !important;
}

.orange-text {
    color: #ff6900;
}

.btn-orange {
    background: linear-gradient(135deg, #ff7a18, #ff3d00);
    border: none;
    transition: 0.3s;
}

.btn-orange:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ff3d00, #ff3d00);
    color: white;
}

.btn-outline-orange {
    color: #ff6900;
    border: 1px solid #ff6900;
    background-color: transparent;
}

.btn-outline-orange:hover {
    background-color: #ff6900;
    color: white;
}

.orange-link {
    color: #ff6900;
    text-decoration: none;
    font-weight: 600;
}

.orange-link:hover {
    color: #ff3d00;
}


   /* Navbar */

.icon-wrapper {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #ff7a18, #ff3d00);
    border-radius: 50%;
}

.icon-wrapper i {
    font-size: 20px;
}

.navbar-brand {
    color: #212529;
}

.nav-link {
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ff6900;
}

.nav-link:hover {
    transform: translateY(-1px);
}


   /* Hero */

.hero-section {
    background:
        radial-gradient(circle at top right, #fff1df, transparent 40%);
}

.hero-badge {
    display: inline-block;
    background-color: #ffedd4;
    color: #ff6900;
    padding: 8px 15px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
}

.hero-image-wrapper {
    position: relative;
}

.hero-image-wrapper img {
    width: 100%;
    height: 430px;
    object-fit: cover;
    background-color: #ffedd4;
}

.floating-card {
    position: absolute;
    bottom: 25px;
    left: 25px;
    right: 25px;
}

.floating-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: #ffedd4;
    color: #ff6900;
    display: flex;
    align-items: center;
    justify-content: center;
}

#floatingRecTitle {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


   /* Sections */

.section-label {
    color: #ff6900;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}


   /* Recipe Card */

.recipe-card {
    background-color: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
}

.recipe-image-wrapper {
    height: 230px;
    position: relative;
}

.recipe-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.recipe-card:hover .recipe-card-img {
    transform: scale(1.03);
}

.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;

    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;

    background-color: white;
    color: #ff6900;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.rating-badge {
    position: absolute;
    top: 15px;
    left: 15px;

    background-color: white;

    padding: 7px 10px;

    border-radius: 30px;

    font-size: 14px;
    font-weight: 600;
}

.rating-badge i {
    color: #ffc107;
}

.rating-badge span {
    color: #777;
    font-weight: 400;
}

.small-badge {
    background-color: #dcfce7;
    color: #008236;

    padding: 5px 10px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}

.small-badge.blue {
    background-color: #dbeafe;
    color: #1447e6;
}


   /* Categories */

.category-card,
.category-large-card {
    text-decoration: none;
    color: #212529;

    background-color: white;

    border-radius: 18px;

    padding: 20px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    min-height: 140px;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);

    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover,
.category-large-card:hover {
    transform: translateY(-5px);
    color: #ff6900;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.category-icon {
    width: 55px;
    height: 55px;

    background-color: #ffedd4;

    color: #ff6900;

    border-radius: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;

    margin-bottom: 10px;

    transition: transform 0.3s ease;
}

.category-icon.large {
    width: 70px;
    height: 70px;
    font-size: 28px;
}

.category-card:hover .category-icon,
.category-large-card:hover .category-icon {
    transform: scale(1.05);
}


   /* Random Box */

.random-box {
    background: linear-gradient(
        135deg,
        #fff2e3,
        #fff8ed
    );

    border: 1px solid #ffe0bd;
}


   /* Search */

.search-box {
    max-width: 700px;
}

.search-box .form-control {
    border: 1px solid #ddd;
    box-shadow: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box .form-control:focus {
    border-color: #ff6900;
    box-shadow: 0 0 0 0.2rem rgba(255, 105, 0, 0.1);
}


   /* Recipe Details */

.recipe-details {
    display: grid;
    grid-template-columns: 42% 58%;

    background-color: white;

    border-radius: 25px;

    overflow: hidden;

    min-height: 680px;
}

.details-image {
    position: relative;
    min-height: 680px;
}

.details-image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-rating {
    z-index: 2;
}

.details-info-card {
    position: absolute;

    bottom: 20px;
    left: 8%;
    right: 8%;

    background-color: white;

    border-radius: 20px;

    padding: 20px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    text-align: center;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.details-info-card div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-width: 0;
}

.details-info-card small {
    color: #777;
}

.details-info-card strong {
    font-size: 14px;

    overflow-wrap: anywhere;
}

.details-content {
    padding: 35px;

    max-height: 680px;

    overflow-y: auto;
}


   /* Tabs */

.custom-tabs {
    border-bottom: 1px solid #ddd;
}

.custom-tabs .nav-link {
    border: none;
    color: #777;
    background-color: transparent;
    font-weight: 600;
}

.custom-tabs .nav-link:hover {
    color: #ff6900;
}

.custom-tabs .nav-link.active {
    color: #ff6900;
    border-bottom: 2px solid #ff6900;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show {
    color: #ff6900;
}


   /* Ingredients */

.ingredients-box {
    background-color: #fff9eb;

    border-radius: 18px;

    padding: 15px;

    max-height: 330px;

    overflow-y: auto;
}

.numbered-list {
    list-style: none;
    padding: 0;
    margin: 0;

    counter-reset: ingredient;
}

.numbered-list li {
    counter-increment: ingredient;

    color: #777;

    padding: 12px 5px;

    display: flex;
    align-items: center;

    font-size: 16px;
}

.numbered-list li::before {
    content: counter(ingredient);

    min-width: 28px;
    height: 28px;

    background-color: #ff6900;
    color: white;

    border-radius: 50%;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    font-weight: bold;

    margin-right: 12px;
}


   /* Instructions */

.instructions-box {
    background-color: #fff9eb;

    border-radius: 18px;

    padding: 20px;

    max-height: 330px;

    overflow-y: auto;
}

.instructions-box li {
    margin-bottom: 18px;
    color: #666;
    line-height: 1.7;
}


   /* Video */

.video-placeholder {
    height: 300px;

    background-color: #fff9eb;

    border-radius: 18px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;
}


   /* Chef Tips */

.chef-tip {
    background-color: #ffedd4;

    border-left: 4px solid #ff6900;

    border-radius: 10px;

    padding: 15px;

    display: flex;

    gap: 12px;

    align-items: center;

    color: #666;
}

.chef-tip i {
    flex-shrink: 0;
}

.chef-tip span {
    overflow-wrap: anywhere;
}


   /* Buttons */

.icon-button {
    width: 42px;
    height: 42px;

    border: none;

    background-color: #ffedd4;

    color: #ff6900;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform 0.2s ease, background-color 0.2s ease;
}

.icon-button:hover {
    background-color: #ff6900;
    color: white;
    transform: translateY(-2px);
}


   /* Favorites */

.empty-icon {
    width: 80px;
    height: 80px;

    margin: auto;

    border-radius: 50%;

    background-color: #ffedd4;

    color: #ff6900;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 30px;

    margin-bottom: 20px;
}


   /* Planner */

.planner-column {
    background-color: white;

    border-radius: 20px;

    padding: 20px;

    min-height: 300px;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
}

.planner-header {
    font-weight: bold;

    font-size: 18px;

    color: #ff6900;

    border-bottom: 1px solid #eee;

    padding-bottom: 15px;

    margin-bottom: 15px;
}

.planner-header i {
    margin-right: 8px;
}

.planner-meals {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-planner {
    height: 200px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    color: #aaa;
}

.empty-planner i {
    width: 50px;
    height: 50px;

    border-radius: 50%;

    background-color: #ffedd4;

    color: #ff6900;

    display: flex;
    align-items: center;
    justify-content: center;
}

.planner-recipe {
    display: flex;

    align-items: center;

    gap: 10px;

    background-color: #fff9eb;

    border-radius: 12px;

    padding: 10px;

    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.planner-recipe:hover {
    transform: translateX(3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.planner-recipe img {
    width: 55px;
    height: 55px;

    object-fit: cover;

    border-radius: 10px;
}

/* =====================================================
   PLANNER MODAL
   ===================================================== */

.planner-modal {
    border: none;

    border-radius: 20px;

    overflow: hidden;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}


.planner-modal .modal-header {
    padding: 22px 24px;

    border-bottom: 1px solid #eee;
}


.planner-modal .modal-body {
    padding: 24px;
}


.planner-modal .modal-footer {
    padding: 16px 24px;

    border-top: 1px solid #eee;
}


/* Title */

.planner-choice-title {

    font-weight: 600;

    margin-bottom: 15px;

    color: #444;
}


.planner-choice-title i {

    color: #ff6900;

    margin-right: 8px;
}


/* Meal Options */

.planner-meal-options {

    display: flex;

    flex-direction: column;

    gap: 12px;
}


.planner-meal-option {

    width: 100%;

    border: 1px solid #eee;

    background-color: white;

    border-radius: 14px;

    padding: 13px;

    display: flex;

    align-items: center;

    gap: 12px;

    text-align: left;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;

    cursor: pointer;
}


.planner-meal-option:hover {

    border-color: #ff6900;

    transform: translateX(3px);

    box-shadow: 0 5px 18px rgba(255, 105, 0, 0.10);
}


.planner-meal-option > span:nth-child(2) {

    display: flex;

    flex-direction: column;

    flex: 1;

    min-width: 0;
}


.planner-meal-option strong {

    color: #333;

    font-size: 15px;
}


.planner-meal-option small {

    color: #999;

    font-size: 12px;

    margin-top: 2px;
}


.planner-meal-option > i {

    color: #aaa;

    font-size: 12px;
}


/* Icons */

.planner-option-icon {

    width: 45px;

    height: 45px;

    min-width: 45px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 18px;
}


.planner-option-icon.breakfast {

    background-color: #fff1df;

    color: #ff6900;
}


.planner-option-icon.lunch {

    background-color: #eaf7ff;

    color: #159bd7;
}


.planner-option-icon.dinner {

    background-color: #eeeaff;

    color: #7057d9;
}


/* Success Modal */

.planner-success-modal {

    border: none;

    border-radius: 20px;

    overflow: hidden;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}


.planner-success-modal .modal-body {

    padding: 30px 25px;
}


.success-icon {

    width: 65px;

    height: 65px;

    margin: auto;

    border-radius: 50%;

    background-color: #e9f9ef;

    color: #22a65a;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 28px;
}


.text-orange {

    color: #ff6900;
}


/* Mobile */

@media (max-width: 576px) {

    .planner-modal {

        margin: 12px;
    }


    .planner-modal .modal-header {

        padding: 18px;
    }


    .planner-modal .modal-body {

        padding: 18px;
    }


    .planner-modal .modal-footer {

        padding: 14px 18px;
    }


    .planner-meal-option {

        padding: 11px;
    }


    .planner-option-icon {

        width: 42px;

        height: 42px;

        min-width: 42px;
    }

}
/* =====================================================
   PLANNER - FIX TABLET OVERFLOW
   ===================================================== */

.planner-column,
.planner-meals,
.planner-recipe {
    min-width: 0;
    max-width: 100%;
}


/* =========================
   TABLET
   768px - 991px
   ========================= */

@media (min-width: 768px) and (max-width: 991.98px) {

    .planner-column {
        width: 100%;
        overflow: hidden;
        padding: 14px;
    }

    .planner-meals {
        width: 100%;
        overflow: hidden;
    }

    .planner-recipe {
        width: 100%;
        max-width: 100%;

        display: flex;
        align-items: center;

        gap: 8px;

        padding: 8px;

        box-sizing: border-box;

        overflow: hidden;
    }

    .planner-recipe img {
        width: 45px;
        height: 45px;

        min-width: 45px;
        max-width: 45px;

        flex-shrink: 0;

        object-fit: cover;

        border-radius: 8px;
    }

    /* مهم جدًا:
       العنصر اللي فيه اسم الوجبة لازم يسمح
       للنص إنه ينكمش */

    .planner-recipe > div {
        min-width: 0;
        max-width: 100%;

        flex: 1;
    }

    .planner-recipe h5,
    .planner-recipe h6,
    .planner-recipe p,
    .planner-recipe span,
    .planner-recipe strong {
        max-width: 100%;

        min-width: 0;

        overflow: hidden;

        text-overflow: ellipsis;

        white-space: nowrap;
    }

}


/* =========================
   SMALL TABLET
   ========================= */

@media (min-width: 768px) and (max-width: 850px) {

    .planner-column {
        padding: 10px;
    }

    .planner-recipe {
        gap: 6px;
        padding: 7px;
    }

    .planner-recipe img {
        width: 40px;
        height: 40px;

        min-width: 40px;
        max-width: 40px;
    }

    .planner-recipe h5,
    .planner-recipe h6 {
        font-size: 13px;
    }

    .planner-recipe p {
        font-size: 11px;
    }

}
   /* Categories Slider */

.categories-slider {
    overflow: hidden;
    width: 100%;
}

.categories-track {
    display: flex;
    gap: 15px;
    width: max-content;

    animation: categoriesMove 25s linear infinite;
}

.categories-track > div {
    width: 180px;
    flex-shrink: 0;
}

.categories-track .category-card {
    height: 150px;
}

@keyframes categoriesMove {

    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

}


   /* Dark Mode */

body.dark-mode {
    background-color: #121212;
    color: #f5f5f5;
}

body.dark-mode .navbar {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

body.dark-mode .navbar-brand {
    color: #f5f5f5;
}

body.dark-mode .nav-link {
    color: #ccc;
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
    color: #ff6900;
}


/* All headings */

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #f5f5f5;
}


/* Page Header */

body.dark-mode .page-header h1 {
    color: #f5f5f5;
}


/* Section Heading */

body.dark-mode .section-heading h2 {
    color: #f5f5f5;
}


body.dark-mode .hero-section {
    background:
        radial-gradient(circle at top right, #33261b, transparent 40%);
}


body.dark-mode .text-secondary {
    color: #aaa !important;
}


/* Recipe Cards */

body.dark-mode .recipe-card {
    background-color: #1e1e1e;
}

body.dark-mode .recipe-card h5 {
    color: #f5f5f5;
}


/* Categories */

body.dark-mode .category-card,
body.dark-mode .category-large-card {
    background-color: #1e1e1e;
    color: #f5f5f5;
}

body.dark-mode .category-large-card h5,
body.dark-mode .category-card h6 {
    color: #f5f5f5;
}


/* White Sections */

body.dark-mode section.bg-white {
    background-color: #181818 !important;
}


/* Floating Card */

body.dark-mode .floating-card {
    background-color: #1e1e1e !important;
}

body.dark-mode .floating-card h6 {
    color: #f5f5f5;
}


/* Random Box */

body.dark-mode .random-box {
    background: #241e18;
    border-color: #4a3422;
}


/* Search */

body.dark-mode .search-box .form-control {
    background-color: #1e1e1e;
    color: white;
    border-color: #444;
}

body.dark-mode .search-box .form-control::placeholder {
    color: #888;
}


/* Details */

body.dark-mode .recipe-details {
    background-color: #1e1e1e;
}

body.dark-mode .details-content h1 {
    color: #f5f5f5;
}

body.dark-mode .custom-tabs {
    border-color: #444;
}

body.dark-mode .custom-tabs .nav-link {
    color: #aaa;
}

body.dark-mode .custom-tabs .nav-link:hover {
    color: #ff6900 !important;
}

body.dark-mode .ingredients-box,
body.dark-mode .instructions-box,
body.dark-mode .video-placeholder {
    background-color: #252525;
}

body.dark-mode .chef-tip {
    background-color: #33261b;
}
body.dark-mode .meal-add{
    color: black !important;
}

/* Planner */

body.dark-mode .planner-column {
    background-color: #1e1e1e;
}

body.dark-mode .planner-recipe {
    background-color: #252525;
}


/* Dark Mode Button */

body.dark-mode #darkModeBtn {
    background-color: #333;
    color: #ffd43b;
}


   /* Details Image */

.details-image img {
    transition: transform 0.5s ease;
}

.recipe-details:hover .details-image img {
    transform: scale(1.01);
}


   /* Orange Links */

.orange-link {
    transition: color 0.3s ease, transform 0.3s ease;
}

.orange-link:hover {
    transform: translateX(2px);
}


   /* Soft Animations */

.floating-card {
    animation: floatingCard 3s ease-in-out infinite;
}

@keyframes floatingCard {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }

}


   /* Responsive */

@media (max-width: 991px) {

    .recipe-details {
        grid-template-columns: 1fr;
    }

    .details-image {
        min-height: 420px;
        height: 420px;
    }

    .details-content {
        max-height: none;
        overflow-y: visible;
        padding: 28px;
    }

}


@media (max-width: 767px) {

    .details-image {
        min-height: 380px;
        height: 380px;
    }

}


@media (max-width: 576px) {

    .hero-image-wrapper img {
        height: 300px;
    }

    .recipe-image-wrapper {
        height: 210px;
    }

    .details-image {
        min-height: 350px;
        height: 350px;
    }

    .details-info-card {
        padding: 12px 5px;
        left: 4%;
        right: 4%;
    }

    .details-info-card i {
        font-size: 16px !important;
    }

    .details-info-card small {
        font-size: 11px;
    }

    .details-info-card strong {
        font-size: 11px;
    }

    .details-content {
        padding: 20px;
    }

    .custom-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .custom-tabs .nav-link {
        white-space: nowrap;
        font-size: 12px;
    }

}


/* Smallest phones (iPhone SE, older Android, etc.) */
@media (max-width: 400px) {

    .details-image {
        min-height: 300px;
        height: 300px;
    }

    .details-info-card {
        padding: 10px 4px;
        left: 3%;
        right: 3%;
        border-radius: 14px;
    }

    .details-info-card i {
        font-size: 14px !important;
    }

    .details-info-card small {
        font-size: 9.5px;
    }

    .details-info-card strong {
        font-size: 10px;
    }

    .details-content {
        padding: 14px;
    }

    .ingredients-box,
    .instructions-box {
        padding: 14px;
    }

    .numbered-list li,
    .instructions-box li {
        font-size: 14px;
    }

    .numbered-list li::before {
        min-width: 24px;
        height: 24px;
        font-size: 13px;
        margin-right: 10px;
    }

}



   /* Reduced Motion */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

}
/* Details Info Card - Keep values visible in dark mode */
.dark-mode .details-info-card strong {
    color: #212529 !important;
}

.search-error::placeholder {
    color: #ff6900 !important;
    opacity: .8;
    font-size:large;

}


/* ============================
   Font Balance
   ============================ */

.hero-title {
    font-size: clamp(1.9rem, 4.2vw + 1rem, 3.4rem);
    line-height: 1.15;
}

.page-header h1 {
    font-size: clamp(1.6rem, 3vw + 1rem, 2.5rem);
}

.section-heading h2 {
    font-size: clamp(1.35rem, 2vw + 1rem, 2rem);
}

.category-large-card h5 {
    font-size: 1.05rem;
}

.recipe-title {
    font-size: clamp(1.4rem, 2.5vw + 1rem, 2.15rem);
    line-height: 1.25;
    overflow-wrap: break-word;
}

.recipe-description {
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-wrap: break-word;
}


/* ============================
   Recipe Card - layout fix
   ============================ */

.recipe-card {
    display: flex;
    flex-direction: column;
}

.recipe-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.recipe-card-title {
    font-size: 1.05rem;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    min-height: 2.6em;
}

.recipe-card-desc {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-footer {
    margin-top: auto;
}


/* ============================
   Details Header - wrap on mobile
   ============================ */

.details-title-wrap {
    min-width: 0;
}

@media (max-width: 576px) {

    .details-header {
        flex-direction: column-reverse;
        align-items: stretch;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .details-actions {
        justify-content: flex-end;
        margin-left: 0;
    }

}


/* ============================
   Search Modes
   ============================ */

.search-mode-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;

    margin-bottom: 24px;
}

.search-mode-btn {
    border: 1px solid #ddd;
    background-color: white;
    color: #555;

    padding: 8px 18px;
    border-radius: 30px;

    font-weight: 600;
    font-size: 14px;

    transition: 0.25s;
}

.search-mode-btn:hover {
    border-color: #ff6900;
    color: #ff6900;
}

.search-mode-btn.active {
    background: linear-gradient(135deg, #ff7a18, #ff3d00);
    border-color: transparent;
    color: white;
}

body.dark-mode .search-mode-btn {
    background-color: #1e1e1e;
    border-color: #444;
    color: #ccc;
}

body.dark-mode .form-select {
    background-color: #1e1e1e;
    color: white;
    border-color: #444;
}


/* ============================
   Daily Recommendation Toast
   ============================ */

.daily-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1080;

    width: 300px;
    max-width: calc(100% - 40px);

    background-color: white;
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);

    padding: 16px;

    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;

    transition: transform 0.35s ease, opacity 0.35s ease;
}

.daily-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.daily-toast-close {
    position: absolute;
    top: 8px;
    right: 12px;

    border: none;
    background: transparent;

    font-size: 20px;
    line-height: 1;
    color: #999;

    cursor: pointer;
}

.daily-toast-close:hover {
    color: #ff6900;
}

.daily-toast-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.daily-toast-body img {
    width: 55px;
    height: 55px;

    object-fit: cover;
    border-radius: 12px;

    flex-shrink: 0;
}

.daily-toast-body small {
    display: block;

    color: #ff6900;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.daily-toast-body strong {
    display: block;

    font-size: 14px;
    margin-top: 2px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-mode .daily-toast {
    background-color: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

@media (max-width: 576px) {

    .daily-toast {
        left: 15px;
        right: 15px;
        bottom: 15px;
        width: auto;
    }

}


/* ============================
   Additional Responsive & Spacing Polish
   ============================ */

@media (max-width: 991px) {

    .hero-image-wrapper img {
        height: 360px;
    }

    .floating-card {
        left: 15px;
        right: 15px;
    }

}

@media (max-width: 768px) {

    section.py-5 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .page-header {
        margin-bottom: 2rem !important;
    }

    .recipe-card-body {
        padding: 1rem !important;
    }

    .category-card,
    .category-large-card {
        padding: 14px;
        min-height: 120px;
    }

    .random-box {
        padding: 1.5rem !important;
    }

    /* Below this width there isn't enough image height left to
       safely overlap the recommendation card, so it moves below
       the image instead of floating on top of it. */
    .hero-image-wrapper {
        display: flex;
        flex-direction: column;
    }

    .floating-card {
        position: static;
        width: 100%;
        left: auto;
        right: auto;
        bottom: auto;
        margin-top: 14px;
        animation: none;
    }

}

@media (max-width: 576px) {

    .navbar-brand h4 {
        font-size: 1.1rem;
    }

    .navbar-brand small {
        font-size: 11px;
    }

    .search-mode-btn {
        font-size: 12.5px;
        padding: 7px 14px;
    }

    .hero-badge {
        font-size: 12.5px;
        padding: 6px 12px;
    }

    /* More breathing room from the screen edges — cards, badges
       and the navbar were sitting flush against the phone bezel. */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

}

/* =====================================================
   RECIPE DETAILS - RESPONSIVE
   ===================================================== */


/* =========================
   TABLET
   992px and below
   ========================= */

@media (max-width: 991.98px) {

    .recipe-details {
        grid-template-columns: 1fr;

        min-height: auto;

        border-radius: 22px;
    }


    /* Image */

    .details-image {
        min-height: 430px;

        height: 430px;
    }

    .details-image > img {
        height: 100%;

        object-fit: cover;
    }


    /* Info Card */

    .details-info-card {
        left: 6%;
        right: 6%;

        bottom: 20px;

        padding: 16px;
    }


    /* Content */

    .details-content {
        padding: 28px;

        max-height: none;

        overflow-y: visible;
    }


    /* Header */

    .details-header {
        gap: 20px;
    }


    .recipe-title {
        font-size: 32px;
    }


    /* Tabs */

    .custom-tabs {
        display: flex;

        flex-wrap: nowrap;

        overflow-x: auto;

        scrollbar-width: none;
    }

    .custom-tabs::-webkit-scrollbar {
        display: none;
    }

    .custom-tabs .nav-item {
        flex-shrink: 0;
    }


    /* Lists */

    .ingredients-box,
    .instructions-box {
        max-height: 400px;
    }

}


/* =========================
   MOBILE
   768px and below
   ========================= */

@media (max-width: 767.98px) {

    main.py-4 {
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }


    /* Main Card */

    .recipe-details {
        display: block;

        border-radius: 18px;

        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08) !important;
    }


    /* =========================
       IMAGE
       ========================= */

    .details-image {
        min-height: 0;

        height: 320px;
    }

    .details-image > img {
        width: 100%;

        height: 100%;

        object-fit: cover;
    }


    /* =========================
       INFO CARD
       ========================= */

    .details-info-card {

        left: 20px;
        right: 20px;

        bottom: 16px;

        padding: 10px 8px;

        border-radius: 15px;

        grid-template-columns: repeat(3, 1fr);

        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    }


    .details-info-card div {
        gap: 2px;
    }


    .details-info-card i {
        font-size: 15px !important;
    }


    .details-info-card small {
        font-size: 9px;
    }


    .details-info-card strong {
        font-size: 10px;

        max-width: 80px;

        line-height: 1.2;
    }


    /* =========================
       CONTENT
       ========================= */

    .details-content {

        padding: 22px 18px;

        max-height: none;

        overflow: visible;
    }


    /* =========================
       HEADER
       ========================= */

    .details-header {

        flex-direction: column-reverse;

        align-items: stretch;

        gap: 14px;
    }


    .details-actions {

        width: 100%;

        justify-content: flex-end;

        gap: 8px !important;
    }


    .details-title-wrap {
        width: 100%;
    }


    /* =========================
       TITLE
       ========================= */

    .recipe-title {

        font-size: 25px;

        line-height: 1.15;

        margin-top: 12px !important;

        word-break: break-word;
    }


    .recipe-description {

        font-size: 14px;

        line-height: 1.5;

        margin-top: 8px;
    }


    /* =========================
       BADGES
       ========================= */

    .small-badge {

        font-size: 11px;

        padding: 5px 9px;
    }


    /* =========================
       TABS
       ========================= */

    .custom-tabs {

        margin-top: 20px !important;

        width: 100%;

        overflow-x: auto;

        flex-wrap: nowrap;

        scrollbar-width: none;
    }


    .custom-tabs::-webkit-scrollbar {
        display: none;
    }


    .custom-tabs .nav-item {

        flex: 0 0 auto;
    }


    .custom-tabs .nav-link {

        font-size: 12px;

        padding: 10px 8px;

        white-space: nowrap;
    }


    .custom-tabs .nav-link i {

        font-size: 11px;

        margin-right: 3px !important;
    }


    /* =========================
       TAB CONTENT
       ========================= */

    .tab-content {

        margin-top: 18px !important;
    }


    /* =========================
       INGREDIENTS
       ========================= */

    .ingredients-box {

        padding: 12px;

        max-height: 300px;

        border-radius: 14px;
    }


    .numbered-list li {

        font-size: 13px;

        padding: 9px 3px;

        line-height: 1.4;

        align-items: flex-start;
    }


    .numbered-list li::before {

        min-width: 24px;

        width: 24px;

        height: 24px;

        font-size: 11px;

        margin-right: 9px;

        flex-shrink: 0;
    }


    /* =========================
       INSTRUCTIONS
       ========================= */

    .instructions-box {

        padding: 15px;

        max-height: 350px;

        border-radius: 14px;
    }


    .instructions-box li {

        font-size: 13px;

        line-height: 1.6;

        margin-bottom: 14px;
    }


    /* =========================
       CHEF TIPS
       ========================= */

    .chef-tip {

        padding: 12px;

        font-size: 13px;

        gap: 9px;

        align-items: flex-start;
    }


    .chef-tip i {

        margin-top: 2px;
    }


    /* =========================
       BUTTONS
       ========================= */

    .details-content > .d-flex:last-child {

        flex-direction: column;

        width: 100%;
    }


    .details-content > .d-flex:last-child .btn {

        width: 100%;

        justify-content: center;
    }

}


/* =========================
   SMALL MOBILE
   576px and below
   ========================= */

@media (max-width: 576px) {

    .container {

        padding-left: 14px;

        padding-right: 14px;
    }


    /* Image */

    .details-image {

        height: 290px;
    }


    /* Info Card */

    .details-info-card {

        left: 10px;

        right: 10px;

        bottom: 10px;

        padding: 9px 5px;
    }


    .details-info-card small {

        font-size: 8px;
    }


    .details-info-card strong {

        font-size: 9px;
    }


    /* Content */

    .details-content {

        padding: 20px 14px;
    }


    /* Title */

    .recipe-title {

        font-size: 23px;
    }


    .recipe-description {

        font-size: 13px;
    }


    /* Buttons */

    .icon-button {

        width: 40px;

        height: 40px;

        border-radius: 9px;
    }


    /* Horizontal rule */

    .details-content hr {

        margin-top: 20px !important;

        margin-bottom: 20px !important;
    }

}


/* =========================
   VERY SMALL MOBILE
   400px and below
   ========================= */

@media (max-width: 400px) {

    .details-image {

        height: 270px;
    }


    .details-info-card {

        left: 8px;

        right: 8px;
    }


    .details-content {

        padding: 18px 12px;
    }


    .recipe-title {

        font-size: 21px;
    }


    .custom-tabs .nav-link {

        font-size: 11px;

        padding-left: 7px;

        padding-right: 7px;
    }

}

