* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
@font-face {
  font-family: 'Hafez';
  src: url('fonts/DimaShekastehFree.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url("images/back-d.webp") center/cover no-repeat fixed;
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
}
@media (max-width: 768px) {
  body {
     background-image: url("images/back-m.png");
    background-attachment: fixed;
  }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Header ===== */
header {
    background: rgba(16, 34, 71, 0.15);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    top: 0;
    z-index: 100;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-title {
    display: flex;
    align-items: center;
    gap: 15px;
}
.logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
}
header h1 {
    font-family: Hafez, sans-serif;
    color: #c8a15a;
    font-size: 2rem;
    margin: 0;
}
nav {
    display: flex;
    gap: 20px;
    align-items: center;
}
nav a {
    color: #c8a15a;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}
nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== Main ===== */
main {
    padding: 20px 0;
}
main h2 {
    color: #c8a15a;
    margin-bottom: 10px;
    margin-top: 10px;
    font-size: 2rem;
    text-align: center;
}

/* ===== Cafe Info ===== */
.cafe-info-wrapper {
    padding: 40px 0;
    margin-top: 20px;
}
.cafe-info-section {
    background: rgb(16, 34, 71, 0.6);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}
.info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 250px;
}
.info-icon {
    width: 50px;
    height: 50px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4CAF50;
    flex-shrink: 0;
}
.info-content h3 {
    color: #c8a15a;
    margin-bottom: 5px;
    font-size: 1.1rem;
}
.info-content p {
    color: #b0b0b0;
    margin: 0;
}
.social-links {
    flex: 1;
    min-width: 250px;
    text-align: center;
}
.social-links h3 {
    color: #c8a15a;
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.social-icons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
.social-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8a15a;
    text-decoration: none;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
}
.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.social-icon.instagram:hover { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-icon.telegram:hover { background: #0088cc; }
.social-icon.whatsapp:hover { background: #25D366; }
.social-icon.phone:hover { background: #4CAF50; }
.social-icon svg { width: 24px; height: 24px; }

/* ===== Categories ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    row-gap: 20px;
    column-gap: 20px;
    margin-top: 10px;
}
.category-card {
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    width: 120px;
    height: 56px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.category-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px;
}
.category-name {
    font-size: 1rem;
    color: #c8a15a;
    margin-bottom: 5px;
    text-align: center;
}
.list-category-name {
    font-size: 1.2rem;
    color: #c8a15a;
    margin-bottom: 10px;
}

/* ===== Products Grid (public) ===== */
#products-container.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    padding: 30px 0;
}
.card {
    position: relative;
    height: 390px;
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transition: 0.4s;
}
.card:hover { transform: translateY(-8px); }
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .5s;
}
.card:hover img { transform: scale(1.08); }
.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,.1));
}
.content {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 22px;
    z-index: 2;
}
.content h2 {
    color: #f2d4aa;
    font-size: 32px;
    margin-bottom: 10px;
}
.desc {
    color: #efefef;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}
.price-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.price-item, .single-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(233,205,168,.14);
    border: 1px solid rgba(233,205,168,.18);
    padding: 10px 14px;
    border-radius: 14px;
    backdrop-filter: blur(10px);
    color: white;
    gap: 10px;
}
.price-item span, .single-price span {
    color: #f5e4cb;
    font-size: 13px;
    flex: 1;
    text-align: right;
}
.price-item b, .single-price b {
    font-size: 13px;
    white-space: nowrap;
    color: #ffd580;
}

/* ===== Login Page ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.login-box {
    background: #0000004a;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
}
.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #c8a15a;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-weight: 500;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: #f0e6d3;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}
.form-group textarea {
    resize: vertical;
    font-family: inherit;
}
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    font-family: inherit;
}
.btn-primary:hover { background: #45a049; }
.btn-secondary {
    padding: 8px 16px;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: inherit;
}
.btn-secondary:hover { background: #da190b; }
.error-message {
    color: #f44336;
    margin-bottom: 15px;
    text-align: center;
    display: none;
}
.error-message.show { display: block; }
.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #4CAF50;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ===== Admin Panel Layout ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
}

/* فرم افزودن محصول */
.add-form-panel {
    background: rgba(22, 33, 62, 0.75);
    border: 1px solid rgba(200, 161, 90, 0.18);
    border-radius: 18px;
    padding: 28px 24px;
    position: static;
    top: 70px;
}
.add-form-panel h3 {
    color: #c8a15a;
    font-size: 1.15rem;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(200,161,90,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* فیلدهای فرم ادمین */
.field-label {
    display: block;
    color: #b0b0b0;
    font-size: 0.85rem;
    margin-bottom: 6px;
    margin-top: 16px;
}
.field-label:first-of-type { margin-top: 0; }
.admin-field {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #f0e6d3;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.admin-field:focus {
    outline: none;
    border-color: #c8a15a;
    background: rgba(255,255,255,0.09);
}
.admin-field::placeholder { color: rgba(255,255,255,0.25); }
select.admin-field option { background: #1a2847; color: #f0e6d3; }
textarea.admin-field { resize: vertical; min-height: 80px; }

/* آپلود عکس */
.image-upload-box {
    border: 2px dashed rgba(200,161,90,0.35);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    margin-top: 6px;
}
.image-upload-box:hover {
    border-color: #c8a15a;
    background: rgba(200,161,90,0.05);
}
.image-upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.image-upload-box .upload-icon { font-size: 1.8rem; margin-bottom: 6px; }
.image-upload-box p { color: #b0b0b0; font-size: 0.82rem; margin: 0; }
.image-preview-wrap { display: none; }
.image-preview-wrap img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 8px;
}

/* دکمه ثبت */
.btn-add {
    width: 100%;
    margin-top: 20px;
    padding: 13px;
    background: linear-gradient(135deg, #c8a15a, #a07c3a);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-add:hover { opacity: 0.9; }
.btn-add:active { transform: scale(0.98); }
.btn-add:disabled { opacity: 0.55; cursor: not-allowed; }

/* لیست محصولات ادمین */
.products-panel h3 {
    color: #c8a15a;
    font-size: 1.1rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.products-count {
    font-size: 0.8rem;
    background: rgba(200,161,90,0.15);
    color: #c8a15a;
    padding: 3px 10px;
    border-radius: 20px;
}

/* فیلتر و سرچ */
.product-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.search-wrap {
    position: relative;
    flex: 1;
    min-width: 160px;
}
.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}
.filter-input {
    width: 100%;
    padding: 9px 36px 9px 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: #f0e6d3;
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.filter-input:focus {
    outline: none;
    border-color: #c8a15a;
    background: rgba(255,255,255,0.09);
}
.filter-select {
    padding-right: 12px;
    min-width: 155px;
    flex: 0 0 auto;
    cursor: pointer;
}
.filter-select option { background: #1a2847; color: #f0e6d3; }
.no-results {
    color: #b0b0b0;
    text-align: center;
    padding: 40px;
    grid-column: 1/-1;
    font-size: 0.9rem;
}
.admin-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.admin-product-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.admin-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
}
.admin-product-img-wrap {
    position: relative;
    height: 170px;
    background: rgba(0,0,0,0.3);
}
.admin-product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
    gap: 6px;
}
.no-image-placeholder span { font-size: 2rem; }
.admin-product-body { padding: 16px; }
.admin-product-body h4 {
    color: #f0e6d3;
    font-size: 1rem;
    margin-bottom: 6px;
}
.admin-product-body .cat-badge {
    display: inline-block;
    font-size: 0.72rem;
    background: rgba(200,161,90,0.15);
    color: #c8a15a;
    border-radius: 20px;
    padding: 2px 9px;
    margin-bottom: 8px;
}
.admin-product-body .desc {
    color: rgba(255,255,255,0.45);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.admin-product-price {
    color: #4CAF50;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 14px;
}
.admin-product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.btn-edit {
    padding: 9px;
    background: rgba(33,150,243,0.15);
    color: #64B5F6;
    border: 1px solid rgba(33,150,243,0.3);
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-edit:hover { background: rgba(33,150,243,0.28); }
.btn-delete {
    padding: 9px;
    background: rgba(244,67,54,0.12);
    color: #EF9A9A;
    border: 1px solid rgba(244,67,54,0.25);
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-delete:hover { background: rgba(244,67,54,0.25); }

/* ===== مدیریت دسته‌بندی‌ها ===== */
.categories-manage-panel {
    background: rgba(22, 33, 62, 0.75);
    border: 1px solid rgba(200, 161, 90, 0.18);
    border-radius: 18px;
    padding: 28px 24px;
    margin-bottom: 28px;
}
.categories-manage-panel h3 {
    color: #c8a15a;
    font-size: 1.15rem;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(200,161,90,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.add-category-form {
    display: grid;
    grid-template-columns: 1fr 220px auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 22px;
}
.add-category-form .btn-add  { margin-top: 0; width: auto; padding: 11px 22px; }
.category-upload-box { margin-top: 0; padding: 10px; }
.category-upload-box #cat-preview-img { height: 60px; margin-top: 0; }
.categories-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.category-manage-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.25s;
}
.category-manage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.category-drag-handle {
    font-size: 1.15rem;
    color: rgba(200,161,90,0.4);
    cursor: grab;
    line-height: 1;
    user-select: none;
    transition: color 0.2s;
    flex-shrink: 0;
}
.category-drag-handle:active { cursor: grabbing; }
.category-manage-card:hover .category-drag-handle { color: rgba(200,161,90,0.8); }
.category-manage-card.dragging {
    opacity: 0.45;
    transform: scale(0.97);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.category-manage-card.drag-over {
    outline: 2px dashed rgba(200,161,90,0.7);
    outline-offset: 3px;
    background: rgba(200,161,90,0.07);
}
.category-manage-img-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.category-manage-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.category-manage-img-wrap .no-image-placeholder { font-size: 1.2rem; }
.category-manage-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.category-manage-name {
    color: #f0e6d3;
    font-size: 0.92rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.category-manage-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.category-manage-actions .btn-edit,
.category-manage-actions .btn-delete {
    padding: 6px;
    font-size: 0.78rem;
}
@media (max-width: 700px) {
    .add-category-form { grid-template-columns: 1fr; }
    .add-category-form .btn-add { width: 100%; padding: 13px; }
}
@media (max-width: 768px) {
    #categories-manage-toggle { cursor: pointer; }
    .categories-manage-panel.collapsed .categories-manage-body { display: none; }
}

/* ===== Toast notification ===== */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e3a1e;
    border: 1px solid #4CAF50;
    color: #a5d6a7;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(.17,.67,.35,1.3);
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error {
    background: #3a1e1e;
    border-color: #f44336;
    color: #ef9a9a;
}

/* ===== Loading skeleton ===== */
.skeleton-card {
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    overflow: hidden;
    animation: shimmer 1.4s infinite;
}
.skeleton-img { height: 170px; background: rgba(255,255,255,0.07); }
.skeleton-body { padding: 16px; }
.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.07);
    margin-bottom: 10px;
}
.skeleton-line.short { width: 60%; }
@keyframes shimmer {
    0%,100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Edit Product Page ===== */
.edit-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 10px 0 40px;
}
.edit-card {
    background: rgba(22, 33, 62, 0.75);
    border: 1px solid rgba(200,161,90,0.18);
    border-radius: 20px;
    padding: 32px 28px;
}
.edit-card h2 {
    color: #c8a15a;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(200,161,90,0.2);
}
.image-section { margin-top: 18px; }
.current-image-wrap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    display: none;
}
.current-image-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.current-image-wrap .img-label {
    background: rgba(0,0,0,0.5);
    color: #b0b0b0;
    font-size: 0.75rem;
    padding: 6px 12px;
    text-align: center;
}
.new-preview-wrap { display: none; margin-top: 10px; }
.new-preview-wrap img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}
.change-label {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #c8a15a;
}
.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}
.btn-save {
    padding: 13px;
    background: linear-gradient(135deg, #c8a15a, #a07c3a);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}
.btn-save:hover { opacity: 0.88; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cancel {
    padding: 13px;
    background: rgba(255,255,255,0.05);
    color: #b0b0b0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.btn-cancel:hover { background: rgba(255,255,255,0.1); }
.loading-state {
    text-align: center;
    padding: 50px;
    color: #b0b0b0;
}

/* ===== Footer ===== */
footer {
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}
footer p { color: #b0b0b0; }

/* ===== Error ===== */
p.error {
    text-align: center;
    color: #ef9a9a;
    padding: 40px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    .logo-title {
        flex-direction: column;
        text-align: center;
    }
    .cafe-info-section {
        flex-direction: column;
        text-align: center;
    }
    .info-card {
        flex-direction: column;
        text-align: center;
    }
    .products-grid,
    .admin-products-grid {
        grid-template-columns: 1fr;
    }
    .login-box {
        padding: 30px 20px;
    }
    .form-actions {
        grid-template-columns: 1fr;
    }

    /* ===== پنل ادمین موبایل ===== */
    .admin-layout {
        gap: 16px;
    }

    /* فرم افزودن: sticky رو موبایل خاموش، collapsible می‌شه */
    .add-form-panel {
        position: static;
        padding: 20px 16px;
        border-radius: 14px;
    }
    .add-form-panel h3 {
        font-size: 1rem;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        cursor: pointer;
        user-select: none;
        justify-content: space-between;
    }
    .add-form-panel h3::after {
        content: '▼';
        font-size: 0.75rem;
        color: #c8a15a;
        transition: transform 0.3s;
    }
    .add-form-panel.collapsed h3::after {
        transform: rotate(-90deg);
    }
    .add-form-panel .form-body {
        margin-top: 18px;
        border-top: 1px solid rgba(200,161,90,0.2);
        padding-top: 16px;
    }
    .add-form-panel.collapsed .form-body {
        display: none;
    }
    .field-label { margin-top: 14px; font-size: 0.82rem; }
    .admin-field { font-size: 0.9rem; padding: 10px 12px; }
    .btn-add { margin-top: 16px; padding: 12px; font-size: 0.95rem; }

    /* فیلتر و سرچ */
    .product-filters {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }
    .filter-select {
        min-width: unset;
        width: 100%;
    }

    /* کارت‌های محصول */
    .admin-products-grid {
        gap: 12px;
    }
    .admin-product-card {
        border-radius: 12px;
    }
    .admin-product-img-wrap {
        height: 140px;
    }
    .admin-product-body {
        padding: 12px;
    }
    .admin-product-body h4 {
        font-size: 0.95rem;
    }
    .admin-product-actions {
        display: flex;
        flex-direction: row;
        gap: 8px;
    }
    .btn-edit, .btn-delete {
        flex: 1;
        padding: 8px 6px;
        font-size: 0.8rem;
        text-align: center;
    }

    /* products-panel */
    .products-panel h3 {
        font-size: 1rem;
        margin-bottom: 14px;
    }
}
/* ===== فیچرهای جدید ===== */

/* انیمیشن fade-in برای کارت‌های منو */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: cardFadeIn 0.45s ease both;
}

.category-card {
    animation: cardFadeIn 0.4s ease both;
}

/* drag & drop */
.drag-hint {
    color: rgba(200,161,90,0.55);
    font-size: 0.78rem;
    margin: -8px 0 10px;
    padding-right: 2px;
}

.drag-handle {
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 1.2rem;
    color: rgba(200,161,90,0.4);
    cursor: grab;
    line-height: 1;
    user-select: none;
    transition: color 0.2s;
}
.drag-handle:active { cursor: grabbing; }
.admin-product-card:hover .drag-handle { color: rgba(200,161,90,0.8); }

.admin-product-card {
    position: relative;
    animation: cardFadeIn 0.38s ease both;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.25s;
}

.admin-product-card.dragging {
    opacity: 0.45;
    transform: scale(0.97);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.admin-product-card.drag-over {
    outline: 2px dashed rgba(200,161,90,0.7);
    outline-offset: 3px;
    background: rgba(200,161,90,0.07);
}

/* وضعیت ناموجود */
.admin-product-card.unavailable {
    opacity: 0.55;
}
.admin-product-card.unavailable .admin-product-img-wrap {
    filter: grayscale(0.6);
}

.btn-toggle-avail {
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.btn-available {
    background: rgba(76,175,80,0.15);
    color: #81c784;
    border: 1px solid rgba(76,175,80,0.3);
}
.btn-available:hover {
    background: rgba(76,175,80,0.25);
}
.btn-unavailable {
    background: rgba(244,67,54,0.12);
    color: #ef9a9a;
    border: 1px solid rgba(244,67,54,0.25);
}
.btn-unavailable:hover {
    background: rgba(244,67,54,0.22);
}

/* پیش‌نمایش زنده */
.live-preview-section {
    margin-top: 20px;
}

.live-preview-card {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(16,24,56,0.7);
    border: 1px solid rgba(200,161,90,0.2);
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.prev-card-img-wrap {
    position: relative;
    height: 140px;
    overflow: hidden;
}
.prev-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.prev-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,18,50,0.85) 0%, transparent 55%);
}

.prev-card-body {
    padding: 14px 16px 16px;
}
.prev-card-body h4 {
    color: #f0e6d3;
    font-size: 0.95rem;
    margin: 0 0 4px;
}
.prev-card-body p {
    color: #9a9a9a;
    font-size: 0.78rem;
    margin: 0 0 10px;
    line-height: 1.5;
}

.prev-price-box { display: flex; flex-direction: column; gap: 4px; }
.prev-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}
.prev-price-row span { color: #9a9a9a; }
.prev-price-row b { color: #c8a15a; font-weight: 600; }
.prev-price-single {
    color: #c8a15a;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ===================================================== */
/* ===== پاپ‌آپ خوش‌آمدگویی / تبلیغاتی (سایت اصلی) ===== */
/* ===================================================== */
body.popup-open { overflow: hidden; }
.site-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 14, 32, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.site-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}
.site-popup-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    max-height: 88dvh;
    background: linear-gradient(180deg, rgba(26, 40, 71, 0.98), rgba(16, 26, 51, 0.98));
    border: 1px solid rgba(200, 161, 90, 0.25);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(18px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.2,.9,.3,1.2), opacity 0.3s ease;
}
.site-popup-overlay.is-visible .site-popup-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.site-popup-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(8, 14, 32, 0.55);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s, transform 0.15s;
}
.site-popup-close:hover { background: rgba(244, 67, 54, 0.75); }
.site-popup-close:active { transform: scale(0.92); }
.site-popup-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 45vh;
    background: rgba(0,0,0,0.25);
    overflow: hidden;
    flex-shrink: 0;
}
.site-popup-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.site-popup-body {
    padding: 22px 24px 26px;
    text-align: center;
    overflow-y: auto;
}
.site-popup-title {
    font-family: Hafez, sans-serif;
    color: #c8a15a;
    font-size: 1.4rem;
    margin: 0 0 10px;
}
.site-popup-text {
    color: #d8d8d8;
    font-size: 0.92rem;
    line-height: 1.8;
    margin: 0;
    white-space: pre-line;
}
.site-popup-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 11px 28px;
    background: linear-gradient(135deg, #c8a15a, #a07c3a);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: bold;
    transition: opacity 0.2s, transform 0.1s;
}
.site-popup-btn:hover { opacity: 0.9; }
.site-popup-btn:active { transform: scale(0.97); }

@media (max-width: 480px) {
    .site-popup-card { max-width: 100%; border-radius: 16px; }
    .site-popup-body { padding: 18px 18px 22px; }
    .site-popup-title { font-size: 1.2rem; }
    .site-popup-img-wrap { aspect-ratio: 16 / 10; }
}

/* ===================================================== */
/* ===== مدیریت پاپ‌آپ (پنل ادمین) ===== */
/* ===================================================== */
.popup-manage-panel {
    background: rgba(22, 33, 62, 0.75);
    border: 1px solid rgba(200, 161, 90, 0.18);
    border-radius: 18px;
    padding: 28px 24px;
    margin-bottom: 28px;
}
.popup-manage-panel h3 {
    color: #c8a15a;
    font-size: 1.15rem;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(200,161,90,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.popup-manage-form {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
}
.popup-manage-form .image-upload-box { margin-top: 6px; }
.popup-manage-form .image-preview-wrap img { height: 160px; }
.popup-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.popup-toggle-row span { color: #f0e6d3; font-size: 0.92rem; font-weight: bold; }
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 34px;
    transition: 0.25s;
}
.switch-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    right: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.25s;
}
.switch input:checked + .switch-slider { background: linear-gradient(135deg, #c8a15a, #a07c3a); }
.switch input:checked + .switch-slider::before { transform: translateX(-20px); }
.popup-fields-col { display: flex; flex-direction: column; }
.popup-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.popup-manage-form .btn-add { margin-top: 22px; }
.popup-live-hint {
    color: #8a8a8a;
    font-size: 0.78rem;
    margin-top: 8px;
}
@media (max-width: 768px) {
    #popup-manage-toggle { cursor: pointer; }
    .popup-manage-panel.collapsed .popup-manage-body { display: none; }
}
@media (max-width: 700px) {
    .popup-manage-form { grid-template-columns: 1fr; }
    .popup-btn-row { grid-template-columns: 1fr; }
}
