/* ==========================================================================
   Deliciously Pro Theme - Food Delivery App Styles (Fixed)
   ==========================================================================*/

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--color-text);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(17, 17, 17, 0.4), rgba(17, 17, 17, 0.8));
}

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 2rem;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
}

.location-detector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.location-detector i {
    font-size: 1.25rem;
    color: var(--color-accent);
}

/* FIXED: Added min-height for mobile accessibility (touch targets) */
.location-input,
.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    min-height: 50px; 
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background-color: var(--color-bg);
    color: var(--color-text);
}

.detect-btn,
.search-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--color-accent);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-height: 50px; /* Accessibility */
}

.detect-btn:hover,
.search-btn:hover {
    background-color: var(--color-accent-dark);
}

/* FIXED: Added Focus States for Accessibility */
.location-input:focus,
.search-input:focus,
.detect-btn:focus,
.search-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent), transparent 75%);
}

.hero-text {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ======================
   Tablets & Small Laptops
====================== */
@media (max-width: 992px) {
    .hero-content {
        padding: 3rem 1.5rem;
    }

    .search-container {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .location-detector,
    .search-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .detect-btn,
    .search-btn {
        width: 100%;
        justify-content: center;
    }

    .hero-title {
        font-size: clamp(2.2rem, 6vw, 3rem);
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ======================
   Mobile Devices
====================== */
@media (max-width: 576px) {
    .hero-section {
        min-height: auto;
        padding: 4rem 0;
    }

    .search-container {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .location-input,
    .search-input {
        font-size: .95rem;
        padding: .7rem .9rem;
    }

    .detect-btn,
    .search-btn {
        padding: .7rem 1rem;
        font-size: .9rem;
    }

    .hero-text {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: clamp(1.9rem, 8vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: .95rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: .75rem;
    }

    .hero-buttons a {
        width: 100%;
        text-align: center;
    }
}

/* ======================
   Ultra Small Screens
====================== */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.7rem;
    }

    .hero-subtitle {
        font-size: .9rem;
    }
}

/* ======================
   RTL SUPPORT
====================== */
html[dir="rtl"] .location-detector,
html[dir="rtl"] .search-bar {
    direction: rtl;
}

html[dir="rtl"] .hero-buttons {
    flex-direction: row-reverse;
}

@media (max-width: 576px) {
    html[dir="rtl"] .hero-buttons {
        flex-direction: column;
    }
}

/* --- Categories Section --- */
.app-categories {
    padding: 6rem 0;
    background-color: var(--color-surface);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.category-card {
    background-color: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* FIXED: Added Focus State */
.category-card:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 3rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.category-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
}

/* =====================================================
   Top Restaurants – Professional Enhancements (Refined)
===================================================== */

.top-restaurants {
    padding: 6rem 0;
    background: var(--color-bg);
}

.top-restaurants .restaurants-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

/* Card */
.restaurant-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform .35s ease, box-shadow .35s ease;
}

.restaurant-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

/* Image */
.restaurant-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.restaurant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

/* FIXED: Merged duplicate selectors */
.restaurant-card:hover .restaurant-image img,
.restaurant-card:hover img {
    transform: scale(1.08);
}

/* Badge */
.restaurant-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: .45rem .9rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    color: #fff;
    background: var(--color-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* Content */
.restaurant-info {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.restaurant-name {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: .4rem;
}

.restaurant-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cuisine-type {
    font-size: .85rem;
    color: var(--color-text-muted);
}

/* Rating */
.restaurant-rating {
    display: flex;
    gap: .2rem;
}

.restaurant-rating .icon-star {
    font-size: .9rem;
    color: var(--color-border);
    opacity: .4;
}

.restaurant-rating .icon-star.active {
    color: var(--color-accent);
    opacity: 1;
}

/* Description */
.restaurant-description {
    font-size: .9rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin: 1rem 0;
    flex-grow: 1;
}

/* Footer */
.restaurant-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: .85rem;
}

/* RTL */
html[dir="rtl"] .restaurant-badge {
    left: auto;
    right: 1rem;
}


/* --- Meals Section --- */
.popular-meals {
    padding: 6rem 0;
    background-color: var(--color-surface);
}

.meals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.meal-card {
    background-color: var(--color-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.meal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.meal-image {
    height: 180px;
    overflow: hidden;
}

.meal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.meal-card:hover .meal-image img {
    transform: scale(1.05);
}

.meal-info {
    padding: 1.5rem;
}

.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.meal-name {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.restaurant-name { /* Selector reused, assuming scope or specific styling */
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.meal-description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.meal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-accent);
}

.meal-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* --- Badges Section --- */
.delivery-badges {
    padding: 6rem 0;
    background-color: var(--color-bg);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.badge-item {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.badge-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.badge-icon {
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.badge-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.badge-description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* --- Loyalty Section --- */
.user-accounts {
    padding: 6rem 0;
    background-color: var(--color-surface);
}

.loyalty-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.user-card {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h3 {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.user-info p {
    font-size: 0.875rem;
    color: var(--color-accent);
}

.loyalty-points {
    text-align: center;
    margin-top: 2rem;
}

.points-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-md);
}

.points-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-bg);
}

.points-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.rewards {
    margin-top: 2rem;
}

.rewards-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.rewards-list {
    list-style: none;
    padding: 0;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.reward-icon {
    font-size: 1.25rem;
}

.account-actions {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.actions-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-btn:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
}

.action-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.action-btn span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* --- App Promo Section --- */
.app-promo {
    padding: 6rem 0;
    background-color: var(--color-bg);
}

.app-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.phone-mockup {
    display: flex;
    justify-content: center;
}

.phone-frame {
    width: 280px;
    height: 560px;
    border-radius: 40px;
    /* FIXED: Use variables to respect Dark Mode */
    background-color: var(--color-dark, #1a1a1a);
    padding: 10px;
    box-shadow: var(--shadow-lg);
    position: relative;
    /* Prevent breaking layout on small mobile screens */
    max-width: 100%;
}

.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 30px;
    overflow: hidden;
    /* FIXED: Use variable for background to respect theme */
    background-color: var(--color-bg, #fff);
}

.phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-subtitle {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.app-description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.app-features {
    margin-bottom: 2rem;
}

.app-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--color-text);
}

.app-feature i {
    color: var(--color-accent);
}

.app-buttons {
    display: flex;
    gap: 1rem;
}

.app-btn {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.divider {
    width: 60px;
    height: 3px;
    background-color: var(--color-accent);
    margin: 0 auto 1rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.15rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.18s ease;
    font-family: var(--font-sans);
}

.btn:active,
.btn:focus {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* FIXED: Added Focus Visible */
.btn:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(180deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-bg);
    box-shadow: var(--shadow-sm);
    border-radius: calc(var(--radius-sm) + 2px);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--color-accent-dark), var(--color-accent));
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background-color: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

/* --- Animations (Fixed) --- */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.8s ease forwards;
}

/* FIXED: Use specific keyframes for horizontal movement */
.animate-fade-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeLeft 0.8s ease forwards;
}

.animate-fade-right {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeRight 0.8s ease forwards;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FIXED: New keyframes for Left/Right */
@keyframes fadeLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .hero-content {
        padding: 1rem;
    }

    .search-container {
        padding: 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .restaurants-container {
        grid-template-columns: 1fr;
    }

    .meals-grid {
        grid-template-columns: 1fr;
    }

    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .loyalty-content {
        grid-template-columns: 1fr;
    }

    .app-content {
        grid-template-columns: 1fr;
    }

    .phone-frame {
        /* Responsive scaling */
        width: 240px;
        height: 480px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
    }

    .btn {
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .badges-grid {
        grid-template-columns: 1fr;
    }
}
/* ======================================================
  END FOOD DELIVERY APP HOMEPAGE STYLES
   ====================================================== */