/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Global Styles */
:root {
    --text-color: #333;
    --text-light: #555;
    --text-extra-light: #777;
    --primary-color: #000;
    --icon-color: #1b1b1b;
    --border-color: #eee;
    --button-border-color: #d1d1d1;

    /* Footer Specific Colors */
    --footer-link-color: #737373;
    --footer-title-color: #080808;
    --footer-social-link-color: #131313;
    --footer-follow-us-color: #737373;

    /* Auth Page Specific Colors */
    --auth-page-bg: #f4f7f6;
    --auth-form-bg: #fff;
    --auth-form-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --input-border-color: #ddd;
    --input-focus-border-color: var(--primary-color);
    --link-color: var(--primary-color);
    --link-hover-color: #333;
    --error-color: #dc3545; /* For potential error messages */

    --sidenav-bg: #fff;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --header-height: 70px;
    --mobile-breakpoint: 992px;
    --tablet-breakpoint: 768px;
    --footer-mobile-breakpoint: 768px;
    --footer-small-mobile-breakpoint: 480px;
    
    /* Font System - Using Roboto as primary */
    --font-system: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-arabic: "Noto Kufi Arabic", var(--font-system);
    
    --serif-font: 'Roboto', Georgia, "Times New Roman", Times, serif;
    --sans-serif-font: var(--font-system);
    --page-content-max-width: 1200px;
    --container-padding: 20px;
}

body,
html {
    margin: 0;
    font-family: var(--font-system);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ensure Roboto is applied to all elements */
* {
    font-family: inherit;
}

/* Arabic Font Support */
[lang="ar"] body,
[lang="ar"] html,
body[dir="rtl"],
html[dir="rtl"] {
    font-family: var(--font-arabic);
}

/* Apply Arabic font to all elements when in Arabic mode */
[lang="ar"] *,
[dir="rtl"] * {
    font-family: var(--font-arabic);
}

/* Specific font sizes for Arabic to ensure readability */
[lang="ar"] h1, [dir="rtl"] h1 { font-size: 2.5rem; }
[lang="ar"] h2, [dir="rtl"] h2 { font-size: 2rem; }
[lang="ar"] h3, [dir="rtl"] h3 { font-size: 1.75rem; }
[lang="ar"] h4, [dir="rtl"] h4 { font-size: 1.5rem; }
[lang="ar"] h5, [dir="rtl"] h5 { font-size: 1.25rem; }
[lang="ar"] h6, [dir="rtl"] h6 { font-size: 1rem; }

/* Font Weight Classes */
.font-thin { font-weight: 100; }
.font-extralight { font-weight: 200; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px var(--container-padding);
}

/* --- Header Styles --- */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.desktop-nav {
    display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100px;
        width:  1400px;
        margin: 0 auto;
}
.nav-left,
.nav-right {
    display: flex;
    align-items: center;
}
.nav-left {
    flex: 1;
    justify-content: flex-start;
}
.nav-right {
    flex: 1;
    justify-content: flex-end;
}
.icon-links {
    display: flex;
    align-items: center;
    gap: 5px;
}
.cart-icon-link,
.wishlist-icon-link {
    position: relative;
}
.cart-count-badge,
.wishlist-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color, #ff4444);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}
.nav-left a,
.nav-right .icon-links a,
.language-selector {
    padding: 10px 15px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    transition: color 0.2s ease;
}
.nav-right .icon-links a {
    padding: 10px;
    line-height: 1;
}
.nav-right .icon-links form button {
    color: var(--icon-color, #333);
    transition: color 0.2s ease;
}
.nav-right .icon-links form button:hover {
    color: var(--primary-color);
}
.nav-right .icon-links form button .fas {
    color: inherit;
}
.nav-left a:hover,
.language-selector a:hover {
    color: var(--primary-color);
}
.nav-right .icon-links .fas,
.sidenav-icon-links a .fas {
    font-size: 22px;
    color: var(--icon-color, #333);
    transition: color 0.2s ease;
}
.nav-right .icon-links a:hover .fas,
.sidenav-icon-links a:hover .fas {
    color: var(--primary-color);
}

/* Modified logo styling */
.logo-text-shared {
    font-weight: bold;
    white-space: nowrap;
    direction: ltr !important; /* Prevent logo from flipping in RTL */
    display: inline-block;
}

/* Ensure logo stays LTR even in RTL contexts */
[dir="rtl"] .logo-text-shared,
html[dir="rtl"] .logo-text-shared,
.rtl .logo-text-shared {
    direction: ltr !important;
    unicode-bidi: embed;
}

/* Ensure individual logo letters stay in order */
[dir="rtl"] .logo-text-shared span,
html[dir="rtl"] .logo-text-shared span,
.rtl .logo-text-shared span {
    display: inline-block;
    direction: ltr !important;
}

.nav-logo {
    padding: 0 20px;
    text-align: center;
}

.nav-logo a {
    font-size: 24px;
    letter-spacing: normal;
    color: var(--primary-color);
}

.mobile-logo a {
    font-size: 22px;
    letter-spacing: normal;
    color: var(--primary-color);
}

.sidenav-logo a {
    font-size: 22px;
    letter-spacing: normal;
    color: var(--primary-color);
}

.footer-logo-container a {
    font-size: 24px;
    letter-spacing: normal;
    color: var(--primary-color);
}

.language-selector {
    display: flex;
    align-items: center;
    margin-left: 15px;
}
.language-selector a {
    padding: 0 3px;
    font-size: 11px;
    text-transform: uppercase;
}
.language-selector .active-lang {
    font-weight: bold;
    color: var(--primary-color);
}
.mobile-controls {
    display: none;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}
.hamburger-btn {
    font-size: 22px;
    color: var(--text-color);
    padding: 10px;
    transition: color 0.2s ease;
}
.hamburger-btn i.fas {
    font-size: 22px;
    color: var(--text-color);
    -webkit-text-stroke-width: 0;
    text-stroke-width: 0;
    transition: color 0.2s ease;
}
.hamburger-btn:hover i.fas,
.hamburger-btn:hover {
    color: var(--primary-color);
}
.sidenav {
    height: 100%;
    width: 280px;
    position: fixed;
    z-index: 1001;
    top: 0;
    left: -280px;
    background-color: var(--sidenav-bg);
    overflow-y: auto;
    padding-top: 20px;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}
.sidenav.open {
    left: 0;
}
.sidenav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px 20px 20px 20px;
}
.close-sidenav-btn {
    font-size: 30px;
    color: var(--text-light);
    transition: color 0.2s ease;
}
.close-sidenav-btn:hover {
    color: var(--primary-color);
}
.sidenav nav ul li a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.sidenav nav ul li a:hover {
    background-color: #f7f7f7;
    color: var(--primary-color);
}
.sidenav nav ul li.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 20px;
}
.sidenav-icon-links {
    padding: 10px 20px;
}
.sidenav-icon-links a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-color);
    text-transform: uppercase;
    transition: background-color 0.2s ease;
}
.sidenav-icon-links a .icon-label {
    transition: color 0.2s ease;
}
.sidenav-icon-links a:hover {
    background-color: #f7f7f7;
}
.sidenav-icon-links a:hover .icon-label {
    color: var(--primary-color);
}
.sidenav-icon-links a i.fas {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}
.sidenav-language-selector {
    padding: 15px 20px;
    font-size: 14px;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}
.sidenav-language-selector a,
.sidenav-language-selector span {
    padding: 0 3px;
    transition: color 0.2s ease;
}
.sidenav-language-selector .active-lang {
    font-weight: bold;
    color: var(--primary-color);
}
.sidenav-language-selector a:hover {
    color: var(--primary-color);
}
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 1000; /* Lower than sidenav */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.overlay.active {
    display: block;
    opacity: 1;
}
.no-scroll {
    overflow: hidden;
}
/* --- End Header Styles --- */

/* --- Footer Styles --- */
.site-footer {
    padding-top: 60px;
    padding-bottom: 30px;
    background-color: #fff;
    flex-shrink: 0;
}
.footer-container {
    max-width: var(--page-content-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}
.footer-main-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 20px;
}
.footer-column {
    flex: 1 1 200px;
    min-width: 180px;
}
.footer-column h4 {
    font-family: var(--serif-font);
    font-size: 18px;
    font-weight: 500;
    color: var(--footer-title-color);
    margin-top: 0;
    margin-bottom: 20px;
}
.footer-column ul li {
    margin-bottom: 10px;
}
.footer-column ul li a {
    font-family: var(--sans-serif-font);
    font-size: 13px;
    color: var(--footer-link-color);
    transition: color 0.2s ease;
}
.footer-column ul li a:hover {
    color: var(--primary-color);
}
.footer-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 20px;
}
.footer-social,
.footer-logo-container,
.footer-region {
    flex: 1;
    font-size: 12px;
}
.footer-social {
    text-align: left;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 10px;
}
.footer-social .follow-us-label {
    color: var(--footer-follow-us-color);
    margin-right: 5px;
}
.footer-social a {
    color: var(--footer-social-link-color);
    font-weight: 500;
    transition: color 0.2s ease;
}
.footer-social a:hover {
    color: var(--primary-color);
}
.footer-logo-container {
    text-align: center;
    flex-basis: auto;
    order: 0;
}
.footer-logo {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}
.region-selector-wrapper {
    position: relative;
    display: inline-block;
}
.region-selector-trigger {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}
.selected-region-text {
    font-weight: 500;
    color: var(--text-color);
    margin-right: 8px;
}
.region-arrow {
    font-size: 10px;
    color: var(--text-color);
    transition: transform 0.2s ease;
}
.region-selector-trigger[aria-expanded="true"] .region-arrow {
    transform: rotate(180deg);
}
.region-dropdown {
    position: absolute;
    bottom: calc(100% + 5px);
    right: 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
    min-width: 180px;
    padding: 5px 0;
    border-radius: 4px;
}
.region-dropdown[hidden] {
    display: none;
}
.region-dropdown li button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 15px;
    font-size: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
}
.region-dropdown li button:hover {
    background-color: #f7f7f7;
    color: var(--primary-color);
}
/* --- End Footer Styles --- */

/* --- Common Auth Styles --- */
body.auth-page {
    background-color: var(--auth-page-bg);
}

.auth-form-wrapper {
    background-color: var(--auth-form-bg);
    padding: 45px 40px;
    border-radius: 8px;
    box-shadow: var(--auth-form-shadow);
    width: 100%;
    width: 100%;
    text-align: center;
}

.auth-form-wrapper .form-title {
    font-family: var(--serif-font);
    font-size: 26px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form-wrapper .form-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 35px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 22px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    text-align: inherit;
}

.form-group .form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
    color: var(--text-color);
}

.form-group .form-control:focus {
    outline: none;
    border-color: var(--input-focus-border-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

.form-group .form-control::placeholder {
    color: #aaa;
    font-style: normal;
}

/* Ensure checkbox margin-top is 0 for all auth forms */
.auth-page .form-check-input,
.form-check-input {
    margin-top: 0 !important;
}

/* Center button text for all auth submit buttons */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.auth-submit-btn .btn-text {
    text-align: center;
}

.password-input-group {
    position: relative;
}

.password-toggle-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    font-size: 16px;
    transition: color 0.2s ease;
}

.password-toggle-icon:hover {
    color: var(--primary-color);
}

.auth-submit-btn {
    background-color: var(--primary-color);
    color: #fff;
    padding: 14px 20px;
    text-transform: uppercase;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease,
        transform 0.1s ease;
    width: 100%;
    margin-bottom: 25px;
}

.auth-submit-btn:hover {
    opacity: 0.85;
}

.auth-submit-btn:active {
    transform: translateY(1px);
}

.alternative-action {
    font-size: 14px;
    color: var(--text-light);
}

.alternative-action .action-link {
    color: var(--link-color);
    font-weight: 500;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.alternative-action .action-link:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Responsive auth form styles */
@media screen and (max-width: 768px) {
    .auth-form-wrapper {
        padding: 35px 30px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    .auth-form-wrapper .form-title {
        font-size: 24px;
    }
    .auth-form-wrapper .form-subtitle {
        font-size: 13px;
        margin-bottom: 25px;
    }
    .form-group .form-control {
        padding: 11px 14px;
        font-size: 14px;
    }
    .auth-submit-btn {
        padding: 13px 20px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .auth-form-wrapper {
        padding: 30px 20px;
        border-radius: 6px;
    }
    .auth-form-wrapper .form-title {
        font-size: 22px;
    }
}
/* --- End Common Auth Styles --- */

/* --- Responsive Styles --- */
@media screen and (max-width: 992px) {
    /* --mobile-breakpoint */
    .desktop-nav {
        display: none;
    }
    .mobile-controls {
        display: flex;
    }
    .main-header {
        padding: 0 15px;
    }
}

@media screen and (max-width: 768px) {
    /* --tablet-breakpoint / --footer-mobile-breakpoint */
    main {
        padding: 30px var(--container-padding);
    }

    /* Footer responsive styles - 2 columns per row */
    .footer-column {
        flex-basis: calc(50% - 10px);
        min-width: unset;
        padding: 0;
    }
    .footer-main-content {
        gap: 30px 20px;
    }
    .footer-column h4 {
        font-size: 16px;
    }
    .footer-column ul li a {
        font-size: 12px;
    }
    .footer-bottom-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-social,
    .footer-logo-container,
    .footer-region {
        text-align: center;
        flex-basis: 100%;
        margin-bottom: 15px;
    }
    .footer-social {
        justify-content: center;
        order: 1;
    }
    .footer-logo-container {
        order: 0;
        margin-bottom: 25px;
    }
    .footer-region {
        order: 2;
        margin-bottom: 0;
        justify-content: center;
    }
    .region-dropdown {
        right: 50%;
        transform: translateX(50%);
        bottom: auto;
        top: calc(100% + 5px);
    }
}

@media screen and (max-width: 480px) {
    /* --footer-small-mobile-breakpoint */
    main {
        padding: 20px var(--container-padding);
        align-items: flex-start;
    }

    /* Sidenav and footer mobile adjustments */
    .sidenav {
        width: 100%;
        left: -100%;
    }
    .sidenav.open {
        left: 0;
    }
    .mobile-logo a,
    .sidenav-logo a {
        font-size: 20px;
    }
    .nav-right .icon-links .fas,
    .sidenav-icon-links a .fas {
        font-size: 20px;
    }
    .hamburger-btn i.fas {
        font-size: 20px;
        color: var(--text-color);
        -webkit-text-stroke-width: 0;
        text-stroke-width: 0;
    }

    /* Footer STILL 2 columns, adjust for readability */
    .footer-column {
        flex-basis: calc(50% - 5px);
        text-align: left;
    }
    .footer-column:not(:last-child) {
        margin-bottom: 0; /* Remove bottom margin to maintain grid layout */
    }
    .footer-main-content {
        gap: 20px 10px;
    }
    .footer-column ul {
        text-align: left; /* Align text to left instead of center */
    }
    .footer-social .follow-us-label {
        display: block;
        width: 100%;
        margin-bottom: 8px;
        text-align: center;
    }
    .footer-social {
        gap: 8px 12px;
        justify-content: center;
    }
}
