/* ==========================================================================
   Merkato Market - Modern Theme Overlay
   ========================================================================== */

/* ==========================================================================
   AMHARIC / ETHIOPIC FONT — applied automatically to all Ethiopic script text
   ========================================================================== */

/* Global font stack — Noto Sans Ethiopic covers the Ethiopic range,
   Roboto handles Latin, Abyssinica SIL as fallback for Ethiopic */
body,
body * {
    font-family: "Roboto", sans-serif, "Abyssinica SIL", serif;
}

/* Force Ethiopic Unicode range to always use Noto Sans Ethiopic */
@font-face {
    font-family: 'EthiopicStack';
    src: local('Noto Sans Ethiopic');
    unicode-range: U+1200-137F, U+1380-139F, U+2D80-2DDF, U+AB01-AB2F;
}

/* Amharic-specific class for explicit targeting */
.lang-am,
.text-am,
[lang="am"],
[lang="am-ET"] {
    font-family: "Noto Sans Ethiopic", "Abyssinica SIL", sans-serif !important;
    line-height: 1.7 !important;
    letter-spacing: 0 !important;
    font-weight: 500 !important;
}

/* When session language is Amharic, boost line-height for better readability */
.footer-description-am {
    font-family: "Noto Sans Ethiopic", "Abyssinica SIL", sans-serif !important;
    line-height: 1.8 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
}

/* ==========================================================================
   GLOBAL OVERFLOW FIX — prevents any element from causing horizontal scroll
   ========================================================================== */
html {
    overflow-x: hidden !important;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
}

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

/* Fix Bootstrap .row negative margins — keep rows flush inside containers */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Restore gutters only inside .container (fixed-width), not container-fluid */
.container .row {
    margin-left: -15px !important;
    margin-right: -15px !important;
}

/* Slider must stretch full width — no margins, no padding */
.slider-row,
.slider-row > .col-sm-12 {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.slideshow-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Prevent any single element from exceeding the viewport width */
* {
    max-width: 100%;
}

/* Exclude elements that legitimately need to be wider (positioned/fixed) */
.sidenav,
#overlay,
.modal,
.modal-dialog,
.modal-backdrop {
    max-width: none;
}

:root {
    /* Brand Colors */
    --color-primary: #009999;
    --color-primary-dark: #007777;
    --color-primary-light: #e6f5f5;
    
    /* Slate Neutrals */
    --color-slate-900: #0f172a;
    --color-slate-800: #1e293b;
    --color-slate-700: #334155;
    --color-slate-600: #475569;
    --color-slate-300: #cbd5e1;
    --color-slate-100: #f1f5f9;
    --color-slate-50: #f8fafc;
    
    /* Semantic Colors */
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    
    /* Typography */
    --font-family-sans: "Roboto", sans-serif, "Abyssinica SIL", serif;
    --font-family-headers: "Roboto Condensed", "Roboto", sans-serif, "Abyssinica SIL", serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Radii */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Overrides */
body {
    font-family: var(--font-family-sans) !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    color: var(--color-slate-800);
    background-color: var(--color-slate-50);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headers) !important;
    font-weight: 600;
    color: var(--color-slate-900);
    letter-spacing: -0.025em;
}

/* Premium Buttons */
.btn-modern-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white !important;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
}

/* Glassmorphism Header */
.header-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-slate-100);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Modern Card Hover */
.card-modern {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-slate-100);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary-light);
}

/* Badge Animation */
.badge-pop {
    animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Smooth Fade In */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Header styles are fully managed in header.css — no overrides needed here */

.button-primary,
.btn-modern-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)) !important;
    color: white !important;
    border-radius: 999px !important;
    border: none !important;
    padding: 0.75rem 1.35rem !important;
}

.footer-links a,
.footer-contact a,
.footer-newsletter button {
    transition: background var(--transition-fast), color var(--transition-fast);
}

.footer-links a:hover,
.footer-contact a:hover,
.footer-newsletter button:hover {
    background: rgba(0, 153, 153, 0.1);
    color: var(--color-primary);
}

.footer-logo {
    max-width: 80px;
}

.footer-description,
.footer-contact p {
    color: rgba(255, 255, 255, 0.85);
}

.container-fluid.hr {
    background: linear-gradient(180deg, #092826, #153f35) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: white !important;
}

.footer-newsletter button {
    border-radius: 999px;
}

.sidenav {
    background: #fff;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
    border-right: 1px solid rgba(15, 23, 42, 0.06);
}

.sidenavHeader {
    padding: 1.2rem;
    background: var(--color-primary);
    color: white;
    border-radius: 0.75rem 0.75rem 0 0;
}

.sidenavHeader a {
    color: white;
}

.sidenav-divider {
    margin: 0;
    border-color: rgba(15, 23, 42, 0.08);
}

.sidenav-menu-header {
    padding: 0.9rem 1.2rem;
    font-weight: 600;
    color: var(--color-slate-700);
}

.sidenav-settings-link {
    display: block;
    padding: 0.85rem 1.2rem;
    color: var(--color-slate-800);
}

.sidenav-settings-link:hover {
    background: rgba(0, 153, 153, 0.08);
}

.product-card {
    background: white !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal) !important;
    padding-bottom: 15px !important;
}

.product-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--shadow-lg) !important;
}

.product-card img {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
    width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
    background: #fff !important;
}

.product-card h3,
.product-card h4,
.product-card h6 {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: var(--color-slate-900) !important;
    margin: 12px 10px 6px 10px !important;
    min-height: 40px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.product-card p,
.product-card .price {
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    margin: 0 10px 12px 10px !important;
}

.product-card .shop-now-btn,
.product-card #shop_btn,
.product-card .btn-modern-primary,
.btn {
    border-radius: 20px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)) !important;
    color: white !important;
    border: none !important;
    display: inline-block !important;
    transition: all var(--transition-fast) !important;
    box-shadow: var(--shadow-sm) !important;
    cursor: pointer !important;
}

.product-card .shop-now-btn:hover,
.product-card #shop_btn:hover,
.product-card .btn-modern-primary:hover,
.btn:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary)) !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Mobile header layout is managed in header.css */

/* Accessibility helper */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Header second row, nav links, selects, deliver-to, and cart badge
   are all managed in header.css */

.modal-content {
    border: 1px solid rgba(0, 153, 153, 0.4) !important;
    box-shadow: var(--shadow-lg) !important;
}

.modal-header .close {
    font-size: 1.3rem !important;
    color: var(--color-slate-900) !important;
}

.site-footer {
    background: linear-gradient(180deg, #071d1d, #0d2f2f) !important;
    color: white !important;
    padding: 3rem 1rem !important;
}

.site-footer .footer-logo {
    max-width: 90px !important;
}

.footer-brand-name {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin-left: 0.75rem;
}

.site-footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 1rem;
}

.site-footer .footer-description,
.site-footer .footer-contact p,
.site-footer .footer-links a {
    color: rgba(255, 255, 255, 0.8) !important;
}

.site-footer .footer-links a:hover,
.site-footer .footer-contact a:hover,
.site-footer .footer-newsletter button:hover {
    color: white !important;
}

.site-footer .footer-links a {
    display: block;
    margin-bottom: 0.75rem;
}

.site-footer .footer-newsletter button {
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border: none;
    padding: 0.85rem 1.4rem;
}

.site-footer .social-media {
    justify-content: flex-start !important;
    gap: 0.75rem;
}

.site-footer .social-media a {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
}

.footer-contact-link {
    display: inline-block;
    padding: 0.45rem 0 !important;
    color: rgba(255, 255, 255, 0.84) !important;
    text-decoration: none !important;
}

.footer-contact-link:hover {
    color: white !important;
    text-decoration: underline !important;
}

.mobile-app-download {
    margin-top: 1.5rem;
}

.app-download-heading {
    margin-bottom: 0.75rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.app-download-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.app-download-button {
    display: inline-flex !important;
    align-items: center;
    background: #000;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    text-decoration: none;
    width: 220px;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.download-btn-icon {
    font-size: 1.25rem;
    margin-right: 0.85rem;
}

.download-btn-text div:first-child {
    font-size: 0.75rem;
    line-height: 1.2;
}

.download-btn-text div:last-child {
    font-size: 1rem;
    font-weight: 700;
}

.app-download-button:hover {
    transform: translateY(-1px);
    background: #111;
}

.bottom-fixed {
    background-color: #333333;
    color: white;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.footer-credit-link {
    color: #009999 !important;
    font-size: 0.85rem;
}

.footer-credit-link:hover {
    color: #00b7b7 !important;
}

/* cart badge is managed in header.css */
