
@font-face {
    font-family: "Peyda-main";
    src: url("../assets/fonts/peydabold.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}


@font-face {
    font-family: "vazir-main";
    src: url("../assets/fonts/vazir.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "IranNastaliq";
    src: url("../assets/fonts/IranNastaliq.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
}



* {
    font-family: "Peyda-main";
}
/* ========== Reset & Base ========== */
*,*::before,*::after { box-sizing: border-box; margin:0; padding:0; }
body {
    font-family: 'Tahoma', 'Segoe UI', sans-serif;
    background: #f0f4f8;
    color: #333;
    direction: rtl;
    font-size: 15px;
    line-height: 1.6;
}
a { text-decoration: none; color: #007bff; }
img { max-width: 100%; height: auto; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
    text-align: center;
}
.btn-primary {
    background: #007bff;
    color: #fff;
}
.btn-primary:hover { background: #0056b3; }
.btn-outline {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
}
.btn-outline:hover { background: #007bff; color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ========== Header ========== */
.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    flex-wrap: wrap;
    gap: 10px;
}
.logo a {
    font-size: 26px;
    font-weight: bold;
    color: #007bff;
}
.logo span { color: #f39c12; }
.search-bar {
    flex: 1;
    max-width: 450px;
}
.search-form {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    overflow: hidden;
    background: #f9f9f9;
}
.search-form input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    outline: none;
    background: transparent;
    font-size: 14px;
}
.search-form button {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: 0.3s;
}
.search-form button:hover { background: #0056b3; }

.header-actions {
    display: flex;
    align-items: center;
    position: relative;
}
.cart-icon-btn {
    background: #f0f4f8;
    border: none;
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    color: #333;
    transition: 0.3s;
}
.cart-icon-btn:hover { background: #007bff; color: #fff; }
.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
}

/* ========== Navigation ========== */
.main-nav {
    background: #007bff;
    padding: 0;
}
.nav-list {
    display: flex;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.nav-list li a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    font-weight: 500;
    transition: 0.3s;
    white-space: nowrap;
}
.nav-list li a:hover { background: #0056b3; }

/* ========== Popup Cart ========== */
.cart-overlay {
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    display: none;
}
.popup-cart {
    position: fixed;
    top: 0;
    left: -320px; /* RTL: right side */
    width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.popup-cart.open {
    left: 0;
}
.popup-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #007bff;
    color: #fff;
}
.popup-cart-header h3 { margin:0; }
.popup-close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.popup-cart-body { padding: 15px; flex:1; }
.empty-cart { text-align: center; padding: 30px 0; color: #777; }
.cart-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    align-items: center;
}
.cart-item-img { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; }
.cart-item-img img { width:100%; height:100%; object-fit: cover; }
.cart-item-info { flex:1; }
.cart-item-info h4 { font-size: 14px; margin-bottom: 5px; }
.cart-item-price { color: #007bff; font-weight: bold; font-size: 13px; }
.cart-item-qty { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.cart-item-qty button {
    width: 25px; height: 25px;
    background: #eee;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.cart-item-qty .qty-num { min-width: 20px; text-align: center; }
.cart-item-remove { background: none; border: none; color: #dc3545; cursor: pointer; }
.cart-total {
    text-align: left;
    font-size: 16px;
    font-weight: bold;
    margin: 10px 0;
    padding-top: 10px;
    border-top: 2px solid #eee;
}

/* ========== Main Content ========== */
.page-title { font-size: 24px; margin-bottom: 20px; color: #222; }
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
    cursor: pointer;
}
.product-card:hover { box-shadow: 0 5px 20px rgba(0,0,0,0.1); transform: translateY(-3px); }
.product-card-img {
    height: 220px;
    overflow: hidden;
    background: #f0f4f8;
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card-body { padding: 15px; }
.product-card-body h3 { font-size: 16px; margin-bottom: 8px; }
.product-card-cat { font-size: 12px; color: #777; margin-bottom: 10px; }
.product-price { font-weight: bold; color: #007bff; font-size: 16px; }
.product-old-price { text-decoration: line-through; color: #aaa; font-size: 13px; margin-right: 8px; }
.discount-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: #dc3545;
    color: #fff;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 12px;
}

/* ========== Single Product ========== */
.product-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin: 20px 0;
}
.product-gallery {
    flex: 1 1 400px;
}
.product-info {
    flex: 1 1 400px;
}
.main-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f4f8;
    margin-bottom: 10px;
}
.main-image img { width:100%; object-fit: contain; max-height:450px; }
.thumb-images {
    display: flex;
    gap: 10px;
}
.thumb-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}
.thumb-images img.active, .thumb-images img:hover { border-color: #007bff; }

.product-info h1 { font-size: 24px; margin-bottom: 10px; }
.product-info .cat { color: #777; margin-bottom: 15px; }
.product-info .price-section { margin: 20px 0; }
.product-info .current-price { font-size: 24px; font-weight: bold; color: #007bff; }
.product-info .old-price { text-decoration: line-through; color: #aaa; font-size: 18px; margin-right: 10px; }
.product-info .discount-percent { color: #dc3545; font-size: 16px; margin-right: 5px; }
.add-to-cart-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}
.add-to-cart-section input[type="number"] {
    width: 70px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

/* ========== Cart Page ========== */
.cart-page { background: #fff; padding: 25px; border-radius: 12px; margin: 20px 0; }
.cart-page table {
    width: 100%;
    border-collapse: collapse;
}
.cart-page th, .cart-page td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}
.cart-page img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.qty-input { width: 60px; text-align: center; padding: 5px; }

.cart-summary {
    margin-top: 20px;
    text-align: left;
    padding: 15px;
    background: #f0f4f8;
    border-radius: 8px;
}
.cart-summary p { margin-bottom: 8px; }
.discount-form {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}
.discount-form input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}
.delivery-option {
    margin: 15px 0;
    display: flex;
    gap: 15px;
}
.delivery-option label { cursor: pointer; }

/* ========== Checkout ========== */
.checkout-page {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
}
.checkout-form {
    flex: 1 1 500px;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
}
.order-summary {
    flex: 0 0 350px;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    align-self: flex-start;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
}

/* ========== Footer ========== */
.main-footer {
    background: #143d6a;
    color: #ccc;
    padding: 30px 0 15px;
    margin-top: 50px;
}
.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}
.footer-col { flex: 1 1 200px; }
.footer-col h4 { color: #fff; margin-bottom: 15px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: #ccc; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    text-align: center;
    padding-top: 15px;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .header-container { flex-direction: column; align-items: stretch; }
    .search-bar { max-width: 100%; }
    .nav-list { flex-wrap: nowrap; }
    .product-detail { flex-direction: column; }
    .cart-page table, .cart-page thead, .cart-page tbody, .cart-page th, .cart-page td, .cart-page tr {
        display: block;
    }
    .cart-page thead { display: none; }
    .cart-page td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
    }
    .cart-page td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-left: 10px;
    }
    .popup-cart { width: 280px; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .product-card-img { height: 150px; }
    .btn { padding: 8px 15px; }
}
