/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    caret-color: transparent;
    font-family: 'Marhey', sans-serif;
}
:focus {
    outline: none;
}
body {
    font-family: 'Marhey', sans-serif;
    background-color: #f8f8f8;
    color: #333;
    line-height: 1.5;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: 'Marhey', sans-serif;
}

input {
    font-family: 'Marhey', sans-serif;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.top-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.logo {
    flex: 0 0 auto;
}

.logo img {
    width: 140px;
    height: 140px;
    margin-left: 100px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.search-bar {
    position: relative;
    width: 400px;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
}

.search-bar button {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
}

.account {
    margin-left: 20px;
}

.account a {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.account i {
    margin-left: 5px;
}

.cart {
    display: flex;
    align-items: center;
}

.cart-icon {
    position: relative;
    display: inline-block;
    margin-left: 5px;
}

.cart-count {
    position: absolute;
    top: -8px;
    left: -8px;
    background-color: #8b9b8b;
    color: #333;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.cart-total {
    font-weight: 500;
}

/* Navigation Styles */
.main-nav {
    background-color: #fff;
    padding: 10px 0;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    justify-content: center;
    position: relative;
}

.nav-links li {
    margin-left: 50px;
}

.nav-links a {
    font-weight: 500;
    color: #555;
    padding: 5px 0;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: #8B9B8B;
}

.nav-links a.active:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color:#8B9B8B;
    bottom: 0;
    right: 0;
}

.social-icons a {
    margin-right: 15px;
    font-size: 18px;
    color: #555;
}

.social-icons a:hover {
    color: #8B9B8B;
}

/* Page Title */
.page-title {
    background-color: #f0f0f0;
    padding: 15px 0;
    margin-bottom: 30px;
    text-align: center;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

/* Cart Page Styles */
.cart-page {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
}

.cart-table {
    flex: 3;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.cart-sidebar {
    flex: 1;
}

.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.product-info {
    display: flex;
    align-items: center;
}

.product-image {
    width: 80px;
    margin-left: 15px;
}

.product-details h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.product-details p {
    font-size: 14px;
    color: #777;
}

.remove-item {
    color: #999;
    margin-right: auto;
    transition: color 0.3s;
}

.remove-item:hover {
    color: #ff3333;
}

.product-price, .product-subtotal {
    font-weight: 500;
    color: #333;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}

.quantity-selector button {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    font-size: 12px;
}

.quantity-selector input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: none;
    font-size: 14px;
}

/* Cart Summary Styles */
.cart-summary {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.cart-summary h2 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.cart-summary h2 i {
    margin-left: 10px;
    color: #8B9B8B;
}

.coupon-section {
    margin-bottom: 25px;
}

.coupon-section p {
    margin-bottom: 10px;
}

.coupon-input {
    display: flex;
}

.coupon-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.apply-coupon {
    background-color: #f0f0f0;
    color: #333;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    transition: all 0.3s;
}

.apply-coupon:hover {
    background-color: #e0e0e0;
}

.cart-totals {
    margin-bottom: 20px;
}

.cart-totals > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.cart-totals .total {
    font-weight: 700;
    font-size: 18px;
    border-bottom: none;
    margin-top: 10px;
}

.checkout-btn {
    width: 100%;
    background-color: #000;
    color: #fff;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.checkout-btn i {
    margin-left: 10px;
}

.checkout-btn:hover {
    background-color: #333;
}

.continue-shopping {
    text-align: center;
}

.continue-shopping a {
    color: #666;
    font-size: 14px;
    text-decoration: underline;
}

.continue-shopping a:hover {
    color: #8B9B8B;
}

/* Footer Styles */
footer {
    background-color: #222;
    color: #fff;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.footer-logo img {
    height: 40px;
    margin-bottom: 15px;
}

.footer-links h3, .footer-contact h3, .footer-newsletter h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
}

.footer-links h3:after, .footer-contact h3:after, .footer-newsletter h3:after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: #8B9B8B;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a:hover {
    color: #ffd700;
}

.footer-contact p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-contact p i {
    margin-left: 10px;
    color: #ffd700;
}

.footer-contact .social-icons {
    margin-top: 15px;
}

.footer-contact .social-icons a {
    margin-left: 10px;
    font-size: 18px;
    transition: color 0.3s;
}

.footer-contact .social-icons a:hover {
    color: #ffd700;
}

.footer-newsletter p {
    margin-bottom: 15px;
}

.footer-newsletter form {
    display: flex;
}

.footer-newsletter input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px 0 0 4px;
}

.footer-newsletter button {
    background-color: #ffd700;
    color: #333;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    font-weight: 500;
    transition: background-color 0.3s;
}

.footer-newsletter button:hover {
    background-color: #e6c200;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.footer-bottom p {
    font-size: 14px;
    color: #999;
}

.payment-methods img {
    height: 24px;
}

/* Responsive Styles */
/* Large devices (desktops, up to 1200px) */
@media (max-width: 1200px) {
    .container {
        padding: 0 20px;
    }

    .search-bar {
        width: 300px;
    }

    .nav-links li {
        margin-left: 15px;
    }
}

/* Medium devices (tablets, up to 992px) */
@media (max-width: 992px) {
    .search-bar {
        width: 220px;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .cart-page {
        flex-direction: column;
    }

    .cart-sidebar {
        width: 100%;
    }
}

/* Small devices (landscape phones, up to 768px) */
@media (max-width: 768px) {
    .top-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-bar {
        width: 100%;
        margin-top: 15px;
        order: 3;
    }

    .cart-header {
        display: none;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
        position: relative;
    }

    .product-price, .product-quantity, .product-subtotal {
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
        border-top: 1px solid #f0f0f0;
    }

    .product-price:before {
        content: 'السعر:';
        font-weight: 500;
    }

    .product-quantity:before {
        content: 'الكمية:';
        font-weight: 500;
    }

    .product-subtotal:before {
        content: 'المجموع الجزئي:';
        font-weight: 500;
    }

    .quantity-selector {
        margin-right: auto;
    }

     /* خلّي زر الحذف واضح ومكانه ثابت داخل العنصر */
.remove-item {
        position: absolute;
           top: 200px;
        left: 130px;
    }

  .remove-item:hover{ color:#ff3333; }
  .remove-item i{ line-height: 1; }
}
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links h3:after, .footer-contact h3:after, .footer-newsletter h3:after {
        right: 50%;
        transform: translateX(50%);
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
    }


/* Extra small devices (portrait phones, up to 576px) */
@media (max-width: 576px) {
    .logo img {
        height: 120px
    }

    .product-info {
        flex-direction: column;
        text-align: center;
    }

    .product-image {
        margin: 0 auto 15px;
    }
    .cart-item{ position: relative; }
.remove-item {
        position: absolute;
          top: 296px;
        left: 130px;;
    }

  .remove-item:hover{ color:#ff3333; }
  .remove-item i{ line-height: 1; }
}
    .footer-newsletter form {
        flex-direction: column;
    }

    .footer-newsletter input {
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .footer-newsletter button {
        border-radius: 4px;
        width: 100%;
    }

@media (max-width: 375px) {
        .cart-item{ position: relative; }
    .remove-item {
        position: absolute;
       top: 340px;
        left: 130px;
    }

  .remove-item:hover{ color:#ff3333; }
  .remove-item i{ line-height: 1; }
}
    

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100%;
    background-color: #fff;
    z-index: 1000;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.close-menu {
    font-size: 24px;
    color: #333;
    position: absolute;
    top: 20px;
    left: 20px;
    cursor: pointer;
}

.mobile-nav-links {
    margin-top: 60px;
}

.mobile-nav-links li {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.mobile-nav-links a {
    font-size: 16px;
    font-weight: 500;
    display: block;
}

.mobile-social-icons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.mobile-social-icons a {
    margin: 0 10px;
    font-size: 20px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

@media (max-width: 992px) {
    .mobile-menu-btn {
        display: block;
    }
}
/* تنسيقات القائمة المنسدلة للمستخدم */
.user-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-weight: 500;
}

.user-profile i {
    font-size: 16px;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 5px;
    padding: 10px;
    margin-top: 5px;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

.logout-btn {
    width: 100%;
    padding: 8px;
    text-align: right;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-family: 'Marhey', sans-serif;

    transition: color 0.3s;
}

.logout-btn:hover {
    color: #8b9b8b;
}

.logout-btn i {
    font-size: 14px;
}
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
}

.empty-cart-icon {
    font-size: 50px;
    color: #8B9B8B;
    margin-bottom: 20px;
}

.empty-cart h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.empty-cart p {
    color: #666;
    margin-bottom: 20px;
}

.continue-shopping-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #8B9B8B;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.continue-shopping-btn:hover {
    background-color: #7a8a7a;
}
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.toast-notification.success {
    background-color: #4CAF50;
}

.toast-notification.error {
    background-color: #F44336;
}

.toast-notification.info {
    background-color: #2196F3;
}

@keyframes fadeIn {
    from { opacity: 0; bottom: 0; }
    to { opacity: 1; bottom: 20px; }
}