/* ============================================================
   Dokan Food Menu – Frontend Styles
   ============================================================ */

/* ── Reset helpers ────────────────────────────────────────── */
.dfm-menu-page *, .dfm-modal * { box-sizing: border-box; }

/* ── Store header ─────────────────────────────────────────── */
.dfm-store-header {
    background: #1a1a2e center/cover no-repeat;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
}
.dfm-store-header-overlay {
    width: 100%;
    padding: 28px 32px;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.dfm-store-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.dfm-store-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    flex-shrink: 0;
}
.dfm-store-name {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
}
.dfm-store-address {
    color: rgba(255,255,255,.8);
    font-size: 14px;
    margin: 0;
}

/* ── Layout ───────────────────────────────────────────────── */
.dfm-menu-body {
    display: grid;
    grid-template-columns: 220px 1fr 340px;
    gap: 28px;
    align-items: start;
}

/* ── Category nav ─────────────────────────────────────────── */
.dfm-cat-nav {
    position: sticky;
    top: 90px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 16px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.dfm-cat-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dfm-cat-link {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.dfm-cat-link:hover,
.dfm-cat-link-active {
    color: #e8622a;
    background: #fff5f0;
    border-left-color: #e8622a;
}

/* ── Category section ─────────────────────────────────────── */
.dfm-cat-section { margin-bottom: 48px; }
.dfm-cat-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1a1a1a;
}
.dfm-cat-desc {
    color: #888;
    font-size: 14px;
    margin: 0 0 18px;
}

/* ── Items grid ───────────────────────────────────────────── */
.dfm-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ── Item card ────────────────────────────────────────────── */
.dfm-item-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
    position: relative;
}
.dfm-item-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.dfm-item-featured {
    border-color: #f5c518;
    box-shadow: 0 0 0 2px rgba(245,197,24,.25);
}
.dfm-item-img-wrap { overflow: hidden; }
.dfm-item-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.dfm-item-card:hover .dfm-item-img { transform: scale(1.05); }

.dfm-item-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.dfm-item-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.dfm-badge { font-size: 13px; }

.dfm-item-name {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 5px;
    color: #1a1a1a;
    line-height: 1.3;
}
.dfm-item-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px;
    line-height: 1.4;
    flex: 1;
}
.dfm-item-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
}
.dfm-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.dfm-item-price { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.dfm-price-original {
    font-size: 13px;
    text-decoration: line-through;
    color: #bbb;
    margin-right: 4px;
    font-weight: 400;
}
.dfm-price-sale { color: #e8622a; }

.dfm-quick-add {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8622a;
    color: #fff;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    flex-shrink: 0;
}
.dfm-quick-add:hover { background: #c94f1e; transform: scale(1.1); }

.dfm-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
    font-size: 18px;
}

/* ── Cart sidebar ─────────────────────────────────────────── */
.dfm-cart-sidebar {
    position: sticky;
    top: 90px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}
.dfm-cart-header {
    background: #1a1a1a;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}
.dfm-cart-count { font-size: 13px; opacity: .75; }

.dfm-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}
.dfm-cart-empty { color: #bbb; text-align: center; padding: 30px 0; font-size: 14px; }

.dfm-cart-row { padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.dfm-cart-row:last-child { border-bottom: none; }
.dfm-cart-row-name { font-weight: 600; font-size: 14px; color: #1a1a1a; }
.dfm-cart-opts { font-size: 12px; color: #888; margin: 3px 0; }
.dfm-cart-opts span::after { content: ', '; }
.dfm-cart-opts span:last-child::after { content: ''; }
.dfm-cart-row-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.dfm-cart-row-price { font-weight: 700; color: #e8622a; margin-left: auto; }

.dfm-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.dfm-qty-btn:hover { background: #eee; }
.dfm-remove-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
}
.dfm-remove-btn:hover { color: #e44; }

.dfm-cart-footer {
    border-top: 1px solid #eee;
    padding: 16px;
    flex-shrink: 0;
}
.dfm-cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    margin-bottom: 12px;
    color: #333;
}
.dfm-btn-checkout {
    width: 100%;
    padding: 14px;
    background: #e8622a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.dfm-btn-checkout:hover:not(:disabled) { background: #c94f1e; }
.dfm-btn-checkout:disabled { opacity: .45; cursor: not-allowed; }

/* ── Modal ────────────────────────────────────────────────── */
.dfm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dfm-modal {
    background: #fff;
    border-radius: 18px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.dfm-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(0,0,0,.35);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background .15s;
}
.dfm-modal-close:hover { background: rgba(0,0,0,.6); }

.dfm-modal-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 18px 18px 0 0;
    display: block;
}
.dfm-modal-body { padding: 22px 24px 28px; }
.dfm-modal-body h3 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.dfm-modal-desc { color: #666; font-size: 14px; margin: 0 0 10px; line-height: 1.5; }
.dfm-modal-base-price { font-size: 20px; font-weight: 700; color: #e8622a; margin: 0 0 20px; }

.dfm-modal-group { margin-bottom: 20px; }
.dfm-modal-group-label {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}
.dfm-required { color: #e44; font-size: 12px; }
.dfm-modal-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 14px;
}
.dfm-modal-opt:hover { border-color: #e8622a; background: #fff5f0; }
.dfm-modal-opt input { flex-shrink: 0; accent-color: #e8622a; }

.dfm-modal-note { margin-top: 18px; }
.dfm-modal-note label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.dfm-modal-note textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    resize: vertical;
}

.dfm-modal-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eee;
}
.dfm-qty-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f5f5f5;
    border-radius: 30px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.dfm-btn-add-modal {
    flex: 1;
    padding: 14px;
    background: #e8622a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.dfm-btn-add-modal:hover { background: #c94f1e; }

/* ── Vendor dashboard styles ──────────────────────────────── */
.dfm-subnav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
    padding-bottom: 0;
}
.dfm-tab {
    padding: 10px 20px;
    border-radius: 6px 6px 0 0;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    transition: all .15s;
}
.dfm-tab:hover { color: #e8622a; background: #fff5f0; }
.dfm-tab-active {
    color: #e8622a;
    background: #fff;
    border-color: #eee;
    border-bottom-color: #fff;
}
.dfm-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.dfm-list-header h2 { margin: 0; }

.dfm-items-table td { vertical-align: middle; }
.dfm-badge-featured {
    display: inline-block;
    font-size: 11px;
    background: #fff8dc;
    border: 1px solid #f5c518;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    color: #7a6000;
}
.dfm-toggle { font-size: 22px; text-decoration: none; }
.dfm-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.dfm-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.dfm-group-block {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    background: #fafafa;
}
.dfm-group-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.dfm-group-name { flex: 1; min-width: 180px; }
.dfm-group-type { min-width: 140px; }
.dfm-opt-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.dfm-opt-price { max-width: 100px; }
.dfm-remove-opt {
    background: none;
    border: none;
    color: #d63638;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    .dfm-menu-body { grid-template-columns: 180px 1fr 300px; }
}
@media (max-width: 900px) {
    .dfm-menu-body { grid-template-columns: 1fr; }
    .dfm-cat-nav   { position: static; display: flex; overflow-x: auto; }
    .dfm-cat-nav ul { display: flex; }
    .dfm-cat-link  { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .dfm-cat-link-active { border-bottom-color: #e8622a; }
    .dfm-cart-sidebar { position: static; max-height: none; }
}
@media (max-width: 560px) {
    .dfm-items-grid { grid-template-columns: 1fr; }
    .dfm-store-name { font-size: 20px; }
}

/* ── Delivery / Pickup toggle ─────────────────────────────── */
.dfm-fulfillment-wrap {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.dfm-fulfillment-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.dfm-ft-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 8px;
    background: #f9f9f9;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.dfm-ft-btn:hover   { border-color: #e8622a; color: #e8622a; }
.dfm-ft-active      { border-color: #e8622a; background: #fff5f0; color: #e8622a; }
.dfm-delivery-fields { display: flex; flex-direction: column; gap: 8px; }
.dfm-delivery-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 13px;
    transition: border-color .15s;
}
.dfm-delivery-input:focus { border-color: #e8622a; outline: none; }
.dfm-pickup-info {
    background: #f0fff4;
    border: 1px solid #b7ebc9;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #2d7a47;
}
.dfm-pickup-info p { margin: 0; }

/* ── Image uploader ───────────────────────────────────────── */
.dfm-thumb-preview {
    position: relative;
    display: inline-block;
    margin: 10px 0;
}
.dfm-thumb-preview img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.dfm-thumb-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #e8622a;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.dfm-upload-label { display: inline-block; cursor: pointer; }
.dfm-upload-btn {
    display: inline-block;
    padding: 9px 18px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: all .15s;
    cursor: pointer;
}
.dfm-upload-btn:hover { border-color: #e8622a; color: #e8622a; background: #fff5f0; }
.dfm-upload-status {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
    color: #555;
    vertical-align: middle;
}
