/* eramara styles.css */
:root{
  --primary-color:#B6202D;
  --primary-light:#fff2f3;
  --secondary-color:#333;
  --discount-color:#e74c3c;
  --text-color:#222;
  --bg-color:#f6f7fb;
  --border-color:#eee;
  --white:#fff;
  --shadow:0 2px 8px rgba(0,0,0,0.25);
  --shadow-hover:0 6px 15px rgba(182,32,45,0.1);
  --orange-color:#f97316;
  --green-color:#039962;
  --blue-color:#3b82f6;
  --text-light:#666;
  --dark-blue:#1a2a6c;
  --nav-height:60px;
  --mega-menu-width:90vw;
  --image-width:280px;
  --transition-fast:0.2s ease;
  --transition-normal:0.3s ease;
  --header-height:70px;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Yekan Bakh',Tahoma,sans-serif;
}

@font-face{
  font-family:'Yekan Bakh';
  src:url('/static/fonts/YekanBakh-Light.ttf') format('truetype');
  font-weight:300;
  font-display:swap;
}
@font-face{
  font-family:'Yekan Bakh';
  src:url('/static/fonts/YekanBakh-Regular.ttf') format('truetype');
  font-weight:400;
  font-display:swap;
}
@font-face{
  font-family:'Yekan Bakh';
  src:url('/static/fonts/YekanBakh-Medium.ttf') format('truetype');
  font-weight:500;
  font-display:swap;
}
@font-face{
  font-family:'Yekan Bakh';
  src:url('/static/fonts/YekanBakh-Bold.ttf') format('truetype');
  font-weight:700;
  font-display:swap;
}

body{
  color:var(--text-color);
  line-height:1.6;
  direction:rtl;
  background-color:var(--bg-color);
}

body.modal-open{
  overflow:hidden;
}

label{
  font-weight:500;
  font-size:13px;
}

button,input,select,textarea{
  font-family:'Yekan Bakh';
  font-size:0.825rem;
}

a{
  text-decoration:none;
}

hr{
  border:1px dashed #e5e5e5;
  margin:14px 4%;
}

header{
  position:sticky;
  top:0;
  z-index:1000;
  width:100%;
  background-color:var(--white);
  box-shadow:var(--shadow);
}

.sticky-menu{
  display:none;
}

.breadcrumb-nav{
  margin:16px 2% 0;
  padding:16px 24px;
  background-color:var(--white);
  border-radius:8px;
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
}

.breadcrumb{
  display:flex;
  list-style:none;
  flex-wrap:wrap;
}
.breadcrumb-item + .breadcrumb-item::before{
  content:"/";
  padding:0 8px;
  color:var(--text-light);
}
.breadcrumb-item a{
  color:var(--primary-color);
}
.breadcrumb-item.active{
  cursor:default;
}

.btn-red,.btn-green,.btn-orange{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:6px;
  color:var(--white);
  padding:0.6rem 1rem;
  border-radius:8px;
  font-weight:600;
  font-size:0.85rem;
  border:none;
  cursor:pointer;
  transition:all 0.3s ease;
}
.btn-red{
  background:var(--primary-color);
}
.btn-red:hover{
  background:#8e1a24;
}
.btn-green{
  background:#1d6f42;
}
.btn-green:hover{
  background:#155732;
}
.btn-orange{
  background:#ff8c00;
}
.btn-orange:hover{
  background:#e67600;
}
.primary-btn{
  background-color:var(--primary-color);
  color:var(--white);
  border:none;
  border-radius:8px;
  padding:10px 32px;
  cursor:pointer;
  font-size:15px;
  font-weight:500;
  transition:0.3s ease;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.primary-btn:hover{
  background-color:var(--primary-color);
  box-shadow:0 6px 12px rgba(182,32,45,0.25);
}

.action-btn{
  color:var(--white);
  background-color:var(--primary-color);
  padding:4px 8px;
  border-radius:4px;
  font-size:13px;
  display:inline-flex;
  align-items:center;
  gap:5px;
  border:none;
  cursor:pointer;
}

.filter-button{
  background:var(--primary-color);
  color:var(--white);
  border:none;
  border-radius:6px;
  padding:0.6rem 1rem;
  cursor:pointer;
  font-weight:600;
  width:100%;
  transition:all 0.3s ease;
}
.filter-button:hover{
  background:#8e1a24;
}

.auth-card{
  width:100%;
}

.pagination{
  display:flex;
  justify-content:center;
  margin:1.5rem;
  gap:0.4rem;
  flex-wrap:wrap;
}
.pagination a,.pagination span{
  padding:6px 10px;
  border:1px solid #ddd;
  border-radius:5px;
  color:var(--secondary-color);
  font-size:0.85rem;
  transition:all 0.3s ease;
}
.pagination a:hover{
  background:var(--primary-light);
  border-color:var(--primary-color);
}
.pagination .current{
  background:var(--primary-color);
  color:white;
  border-color:var(--primary-color);
}

.section-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
  flex-wrap:wrap;
  gap:10px;
}

.filter-header{
  display:flex;
  justify-content:space-between;
  cursor:pointer;
}
.filter-header h4{
  margin:0;
  font-size:1rem;
  display:flex;
  align-items:center;
  gap:0.5rem;
}
.filter-header h4 i{
  color:#B6202D;
}

.filter-toggle{
  background:none;
  border:none;
  font-size:1rem;
  color:#666;
  transition:transform 0.3s ease;
}
.filter-toggle.rotated{
  transform:rotate(180deg);
}

.filter-body{
  padding:1.5rem;
  display:none;
}
.filter-body.show{
  display:block;
}

.filter-section{
  background:var(--white);
  border-radius:12px;
  padding:1rem;
  margin-bottom:1.5rem;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
}

.filter-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:1rem;
}

.filter-group label{
  display:block;
  margin-bottom:0.25rem;
  font-size:0.8rem;
  font-weight:bold;
  color:#555;
}
.filter-group input,.filter-group select{
  padding:0.5rem;
  border:1px solid var(--border-color);
  border-radius:6px;
  font-size:0.85rem;
  width:100%;
}

.filter-buttons{
  display:flex;
  gap:10px;
  align-items:flex-start;
  direction:ltr;
}
.filter-buttons button{
  padding:0.5rem 1.5rem;
  border:none;
  border-radius:6px;
  cursor:pointer;
  font-size:0.85rem;
}

.btn-apply{
  background:#B6202D;
  color:white;
}
.btn-apply:hover{
  background:#8e1a24;
}
.btn-clear{
  background:#6c757d;
  color:white;
}
.btn-clear:hover{
  background:#5a6268;
}

.modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(0,0,0,0.45);
  background:rgba(0,0,0,0.6);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  justify-content:center;
  align-items:center;
}

.modal-content{
  background:var(--white);
  border-radius:14px;
  width:95%;
  max-width:420px;
  padding:1.5rem;
  animation:fadeIn 0.3s ease-out;
}

.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid var(--border-color);
  margin-bottom:1rem;
  padding-bottom:0.75rem;
}
.modal-header h3{
  font-size:1.1rem;
  color:var(--primary-color);
}

.close-modal{
  font-size:24px;
  cursor:pointer;
  color:var(--primary-color);
  transition:all 0.3s ease;
}

.modal-footer{
  display:flex;
  justify-content:flex-end;
}

.toast{
  position:fixed;
  top:24px;
  right:40px;
  left:auto;
  padding:16px 24px;
  border-radius:8px;
  color:white;
  font-weight:500;
  z-index:9999;
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
  animation:slideIn 0.3s ease;
  direction:rtl;
  text-align:center;
  min-width:250px;
}
.toast.success{
  background:#27ae60;
}
.toast.error{
  background:#e74c3c;
}
.toast.info{
  background:#3498db;
}
.toast.warning{
  background:#f39c12;
}

form{
  max-width:600px;
  margin:0 auto;
}
.loginForm{
  width:100%;
}

.form-group{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:1rem;
}

.form-label{
  font-size:14px;
  color:#555;
  font-weight:500;
}

.form-control{
  width:100%;
  padding:10px 14px;
  border:1px solid #ccc;
  border-radius:8px;
  background:#fafafa;
  transition:all 0.2s;
}
.form-control:focus{
  border-color:var(--primary-color);
  outline:none;
  box-shadow:0 0 5px rgba(182,32,45,0.25);
  background:var(--white);
}

.form-actions{
  margin-top:28px;
  text-align:center;
}

.filter-form{
  display:flex;
  gap:1rem;
  margin-bottom:1.5rem;
  flex-wrap:wrap;
}

.filter-group{
  display:flex;
  flex-direction:column;
  min-width:150px;
  flex:1;
}

.filter-control{
  border:1px solid #ccc;
  border-radius:6px;
  padding:0.45rem 0.6rem;
  font-size:0.85rem;
  transition:all 0.2s;
}
.filter-control:focus{
  border-color:var(--primary-color);
  outline:none;
}

.dashboard-main{
  padding:0 3%;
}

.dashboard-wrapper{
  display:flex;
  gap:1rem;
  align-items:flex-start;
  margin-bottom:1rem;
}

.main-container{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  padding:18px 0;
  margin:0 2%;
}

.content-wrapper{
  flex:1;
  border-radius:10px;
  margin-top:24px;
  width:100%;
}

aside{
  flex:1;
  max-width:280px;
  background:var(--white);
  border-radius:10px;
  box-shadow:0 3px 8px rgba(0,0,0,0.08);
  position:sticky;
  top:2rem;
  height:fit-content;
}

.panel-hero,.panel-welcome{
  background:var(--primary-color);
  color:var(--white);
  border-radius:10px;
  padding:2.4rem 2.8rem;
  text-align:center;
  margin-bottom:18px;
  width:100%;
}
.panel-welcome{
  margin-bottom:2rem;
}
.panel-hero h1,.panel-welcome h2{
  font-size:1.8rem;
  font-weight:700;
  margin-bottom:0.5rem;
}
.panel-hero p,.panel-welcome p{
  font-size:1.2rem;
  opacity:0.9;
}

.products h2,.page-header h2{
  color:#444;
  font-size:28px;
}

.page-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:1.5rem;
  flex-wrap:wrap;
  gap:1rem;
}
.page-header h2{
  font-size:1.3rem;
  font-weight:700;
  color:var(--primary-color);
}

.page-actions{
  display:flex;
  gap:0.6rem;
  flex-wrap:wrap;
}

.section-title{
  text-align:center;
  font-size:1.6rem;
  margin:0 0 44px;
  color:#222;
  position:relative;
}
.section-title::after{
  content:'';
  position:absolute;
  bottom:-10px;
  right:50%;
  transform:translateX(50%);
  width:80px;
  height:3px;
  background:var(--primary-color);
  border-radius:2px;
}

.section-header{
  margin-bottom:12px;
  border-bottom:2px solid var(--primary-color);
  display:inline-block;
  padding-bottom:5px;
  color:var(--primary-color);
  font-weight:600;
  font-size:1rem;
}

.table-container{
  margin-bottom:24px;
}

.table-responsive{
  width:100%;
}

.data-table{
  width:100%;
  border-collapse:collapse;
  background:var(--white);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,0.1);
}
.data-table th,.data-table td{
  padding:12px 10px;
  text-align:center;
  border-bottom:1px solid var(--border-color);
  vertical-align:middle;
}
.data-table th{
  background:var(--primary-color);
  color:var(--white);
  font-weight:600;
  font-size:0.85rem;
}
.data-table td{
  font-size:0.85rem;
}
.data-table tr:hover td{
  background:var(--primary-light);
}

.status-icon{
  display:inline-flex;
  align-items:center;
  gap:5px;
}

.product-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
  width:100%;
}

.product-card{
  background:var(--white);
  border-radius:12px;
  overflow:hidden;
  transition:all 0.3s ease;
  box-shadow:0 2px 8px rgba(0,0,0,0.08);
  padding-bottom:16px;
}
.product-card:hover{
  transform:translateY(-5px);
  box-shadow:var(--shadow-hover);
}
.product-card img{
  width:100%;
  height:180px;
  object-fit:contain;
  padding:15px;
}
.product-card h3{
  font-size:1rem;
  margin:10px 12px 4px;
}
.product-card .eng{
  font-size:0.85rem;
  color:#666;
  margin-bottom:8px;
  padding:0 12px;
}

.status-warning{
  background:#fff3cd;
  color:#856404;
  padding:10px;
  border-radius:8px;
  margin-bottom:20px;
  border-right:3px solid #ffc107;
}

.status-info{
  font-size:14px;
  background:#d1ecf1;
  color:#0c5460;
  padding:10px;
  border-radius:8px;
  margin-bottom:20px;
  border-right:3px solid #17a2b8;
}

.footer-bottom{
  text-align:center;
}
.footer-bottom p{
  margin-top:16px;
  color:#f0f0f0;
  font-size:0.8rem;
}

.text-center{
  text-align:center;
}
.text-right{
  text-align:right;
}
.text-left{
  text-align:left;
}
.w-100{
  width:100%;
}
.mt-1{
  margin-top:0.5rem;
}
.mt-2{
  margin-top:1rem;
}
.mt-3{
  margin-top:1.5rem;
}
.mb-1{
  margin-bottom:0.5rem;
}
.mb-2{
  margin-bottom:1rem;
}
.mb-3{
  margin-bottom:1.5rem;
}
.hidden{
  display:none;
}

@keyframes fadeIn{
  from{ opacity:0; transform:scale(0.95); }
  to{ opacity:1; transform:scale(1); }
}
@keyframes slideIn{
  from{ opacity:0; transform:translateY(-20px); }
  to{ opacity:1; transform:translateY(0); }
}

@media (max-width:1199px){
  .product-grid{
    grid-template-columns:repeat(3,1fr);
    gap:18px;
  }
  .products h2{
    font-size:24px;
  }
  .section-title{
    font-size:1.4rem;
    margin-bottom:35px;
  }
}

@media (max-width:799px){
  .dashboard-wrapper{
    flex-direction:column;
  }
  aside{
    max-width:100%;
    position:relative;
    top:0;
  }
  .main-container{
    flex-direction:column;
    gap:1rem;
  }
  .content-wrapper{
    padding:0.5rem;
  }
  form{
    max-width:100%;
  }
  .compact-card{
    background:white;
    border-radius:12px;
  }
  .content-wrapper{
    align-items:flex-end;
    width:100%;
    padding:0;
  }
  .page-header{
    align-items:flex-end;
    flex-direction:column;
    align-items:stretch;
  }
  .page-header h2{
    display:none;
  }
  .hero-content{
    width:100%;
    margin:18px 0;
  }
  .btn.primary,.btn.ghost{
    width:100%;
  }
  .btn-red{
    width:100%;
  }
  .dashboard-cards{
    width:100%;
  }
  .side-menu{
    display:none;
  }
  .sticky-menu{
    display:block;
  }
  .footer-panel{
    display:none;
  }
  .main-container{
    margin:0 3%;
    padding:12px 0;
  }
  .product-grid{
    grid-template-columns:repeat(2,1fr);
    gap:14px;
  }
  .product-card{
    border-radius:10px;
    padding-bottom:12px;
  }
  .product-card img{
    height:120px;
    padding:10px;
  }
  .product-card h3{
    font-size:0.9rem;
    margin:8px 8px 4px;
  }
  .product-card .eng{
    font-size:0.75rem;
    padding:0 8px;
  }
  .section-title{
    font-size:1.2rem;
    margin-bottom:20px;
  }
  .section-title::after{
    display:none;
  }
  .products h2{
    font-size:1.1rem;
  }
  .table-responsive{
    overflow-x:visible;
  }
  .data-table thead{
    display:none;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td{
    display:block;
  }
  .data-table tr{
    background:var(--white);
    border-radius:16px;
    margin-bottom:20px;
    padding:8px 4px;
    box-shadow:var(--shadow);
    border:1px solid var(--border-color);
  }
  .data-table td{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:10px 12px;
    border-bottom:1px solid #f0f0f0;
    font-size:0.85rem;
    text-align:right;
    gap:10px;
  }
  .data-table td:last-child{
    border-bottom:none;
  }
  .data-table td::before{
    content:attr(data-label);
    font-weight:700;
    color:var(--primary-color);
    font-size:0.8rem;
    min-width:95px;
    background:var(--primary-light);
    padding:5px 10px;
    border-radius:8px;
    text-align:center;
    flex-shrink:0;
  }
  .data-table td[data-label="کد"]{
    direction:ltr;
    text-align:left;
    font-family:monospace;
    font-size:0.8rem;
  }
  .filter-form{
    flex-direction:column;
    gap:0.8rem;
  }
  .filter-group{
    min-width:auto;
  }
  .filter-control,.filter-button{
    width:100%;
  }
  .filter-group label{
    font-size:0.8rem;
    margin-bottom:4px;
  }
  .breadcrumb-nav{
    margin:10px 3%;
    padding:10px 16px;
  }
  .breadcrumb-item{
    font-size:11px;
  }
  .pagination{
    margin-top:20px;
    margin-bottom:20px;
  }
  .pagination a,.pagination span{
    padding:8px 12px;
    font-size:0.8rem;
  }
  .page-actions{
    justify-content:center;
  }
  .btn-red,.btn-green{
    padding:0.8rem 0.8rem;
    font-size:0.75rem;
  }
  .page-header h2{
    font-size:1.1rem;
    text-align:center;
  }
}

@media (max-width:399px){
  .filter-section{
    margin-bottom:1rem;
  }
  .subcategories-grid{
    grid-template-columns:1fr;
  }
  .logo{
    display:none;
  }
  .nav-container{
    display:none;
  }
  .search-bar{
    display:none;
  }
  .contact-image img{
    display:none;
  }
  .user-actions a{
    font-size:16px;
  }
  .logo img{
    height:36px;
  }
  .cart-dropdown{
    width:320px;
    left:-50px;
  }
  .cart-dropdown{
    position:fixed;
    top:30%;
    left:50%;
    transform:translate(-50%,-50%);
    width:90%;
    max-width:360px;
    max-height:80vh;
    margin:0;
    border-radius:16px;
    z-index:1300;
  }
  .toast{
    font-size:12px;
    width:100%;
    padding:12px 24px;
  }
  .product-grid{
    gap:12px;
  }
  .product-card img{
    height:105px;
  }
  .product-card h3{
    font-size:0.8rem;
  }
  .data-table td{
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    padding:10px;
  }
  .data-table td::before{
    margin-left:0;
    margin-bottom:5px;
    width:100%;
    display:inline-block;
    text-align:center;
  }
  .data-table td[data-label="کد"]{
    text-align:center;
    word-break:break-all;
  }
  .modal-content{
    padding:1rem;
    width:95%;
  }

  .breadcrumb-nav{
    padding:16px 12px;
  }
  .breadcrumb-item{
    font-size:12px;
  }
}
