/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: #ffffff;
    color: #1e293b;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== متغيرات الألوان (أسود + أبيض) ========== */
:root {
    --primary-color: #000000;      /* أسود */
    --primary-dark: #333333;        /* رمادي داكن */
    --text-dark: #000000;
    --text-light: #666666;
    --border-color: #e2e2e2;
    --bg-light: #f8f8f8;
    --white: #ffffff;
}

/* ========== TOP ANNOUNCEMENT BAR ========== */
.top-bar {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    border-bottom: 1px solid #333;
}

.top-bar marquee {
    display: inline-block;
    width: 100%;
}

/* ========== HEADER ========== */
.header {
    background: var(--white);
    color: var(--text-dark);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

.logo p {
    font-size: 0.8rem;
    color: var(--text-light);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    font-size: 1rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.user-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.user-actions a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.2rem;
    position: relative;
}

.cart-count {
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    position: absolute;
    top: -8px;
    right: -12px;
    font-weight: 600;
}

/* ========== HERO SECTION ========== */
.hero {
    background: var(--bg-light);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ========== SECTION TITLES ========== */
.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    position: relative;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 2px;
    background: var(--primary-color);
    display: block;
    margin: 10px auto;
}

/* ========== PRODUCTS GRID ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--white);
    overflow: hidden;
    transition: 0.3s;
    text-align: center;
}

.product-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.product-img {
    background-color: #f0f0f0; /* خلفية أثناء التحميل */
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
    opacity: 0; /* تبدأ مخفية ثم تظهر بعد التحميل */
}

.product-img img.loaded {
    opacity: 1;
}

.product-card:hover .product-img img {
    transform: scale(1.02);
}

.product-info {
    padding: 15px 10px;
}

.product-info h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.product-info h4 a {
    color: inherit;
    text-decoration: none;
}

.price-container {
    margin-bottom: 10px;
}

.original-price {
    color: var(--text-light);
    font-size: 0.9rem;
    text-decoration: line-through;
    margin-left: 8px;
}

.current-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.product-size {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.add-to-cart {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    transition: 0.3s;
    font-size: 0.9rem;
}

.add-to-cart:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* ========== FEATURES SECTION ========== */
.features-section {
    background: var(--bg-light);
    padding: 40px 0;
    margin: 40px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-item h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--white);
    color: var(--text-dark);
    padding: 50px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 600;
}

.footer-col p,
.footer-col a {
    color: var(--text-light);
    line-height: 2;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icons a {
    background: transparent;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

.social-icons a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ========== BUTTONS ========== */
.btn {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 25px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* ========== AUTH PAGES ========== */
.auth-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.auth-card p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
    text-align: right;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    margin: 10px 0;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 25px 0;
    color: var(--text-light);
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.social-login {
    display: flex;
    gap: 15px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.3s;
    color: var(--text-dark);
}

.social-btn.google:hover {
    background: #db4437;
    color: white;
    border-color: #db4437;
}

.social-btn.facebook:hover {
    background: #4267B2;
    color: white;
    border-color: #4267B2;
}

.auth-footer {
    margin-top: 25px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* ========== CART PAGE ========== */
.cart-section {
    margin: 40px auto;
    min-height: 400px;
}

.cart-title {
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 600;
    color: var(--text-dark);
}

.cart-table {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 100px;
    height: 100px;
    overflow: hidden;
    background: var(--bg-light);
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 2;
}

.cart-item-details h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
}

.cart-item-remove {
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}

.cart-item-remove:hover {
    color: var(--primary-color);
}

.cart-summary {
    margin-top: 30px;
    text-align: left;
    background: var(--white);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.cart-total {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.checkout-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
}

.checkout-btn:hover {
    background: var(--primary-dark);
}

.empty-cart {
    text-align: center;
    padding: 80px;
    color: var(--text-light);
}

.empty-cart i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--text-light);
}

/* ========== PRODUCT DETAILS ========== */
.product-detail {
    display: flex;
    gap: 50px;
    margin: 40px auto;
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 30px;
}

.product-gallery {
    flex: 1;
}

.product-gallery img {
    width: 100%;
    background: var(--bg-light);
}

.product-info-detail {
    flex: 1;
}

.product-info-detail h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.quantity-selector {
    margin: 20px 0;
}

.quantity-selector input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border-color);
}

.btn-large {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
}

.btn-large:hover {
    background: var(--primary-dark);
}

/* ========== ORDERS PAGE ========== */
.orders-section {
    margin: 40px auto;
}

.order-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-id {
    font-weight: 700;
    color: var(--primary-color);
}

.order-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.order-status {
    background: var(--bg-light);
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.order-items {
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.order-item-img {
    width: 50px;
    height: 50px;
    background: var(--bg-light);
}

.order-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-total {
    margin-top: 15px;
    font-weight: 700;
    text-align: left;
}

.empty-orders {
    text-align: center;
    padding: 80px;
    color: var(--text-light);
}

/* ========== CHECKOUT PAGE ========== */
.checkout-section {
    margin: 40px auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.checkout-form,
.checkout-summary {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 30px;
}

.checkout-form h2,
.checkout-summary h3 {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-family: inherit;
}

.checkout-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.checkout-item-img {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
}

.checkout-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checkout-item-details {
    flex: 1;
}

.checkout-total {
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-top: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
}

.btn-place-order {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

.btn-place-order:hover {
    background: var(--primary-dark);
}

/* ========== PROFILE PAGE ========== */
.profile-section {
    margin: 40px auto;
    max-width: 500px;
}

.profile-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 30px;
}

.profile-card h2 {
    margin-bottom: 30px;
}

.btn-save {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
}

.btn-save:hover {
    background: var(--primary-dark);
}

/* ========== ACCOUNT PAGE ========== */
.account-section {
    margin: 40px auto;
}

.account-card {
    display: flex;
    gap: 40px;
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 30px;
}

.account-sidebar {
    flex: 1;
    border-left: 1px solid var(--border-color);
    padding-left: 30px;
}

.account-sidebar h3 {
    margin-bottom: 20px;
}

.account-sidebar ul {
    list-style: none;
}

.account-sidebar li {
    margin-bottom: 15px;
}

.account-sidebar a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    display: block;
    padding: 8px 0;
}

.account-sidebar a:hover,
.account-sidebar a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.account-main {
    flex: 3;
}

.user-info p {
    margin-bottom: 15px;
}

.logout-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 25px;
    font-weight: 600;
    cursor: pointer;
}

.logout-btn:hover {
    background: var(--primary-dark);
}

/* ========== ABOUT PAGE ========== */
.about-content {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 40px;
    margin: 40px auto;
}

.about-content h3 {
    margin-bottom: 20px;
}

.about-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 20px;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.value-card {
    text-align: center;
}

.value-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.value-card h4 {
    margin-bottom: 10px;
    font-weight: 600;
}

/* ========== CONTACT PAGE ========== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px auto;
}

.contact-info,
.contact-form {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 30px;
}

.contact-info h3,
.contact-form h3 {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.info-item i {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.map-container {
    margin: 40px auto;
    height: 400px;
    border: 1px solid var(--border-color);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .checkout-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }
    .nav-links {
        justify-content: center;
    }
    .product-img {
        height: 250px;
    }
    .product-detail {
        flex-direction: column;
    }
    .account-card {
        flex-direction: column;
    }
    .account-sidebar {
        border-left: none;
        padding-left: 0;
    }
}