/*
 * JP-ress Food Ordering - front-end styles.
 * Namespaced under .jpfood-* so nothing collides with the theme.
 * Visual language follows the reference plugin: brand red, square corners,
 * framed images, red price on a rule, round "+" add button, right-edge cart.
 */

:root {
	--jpfood-accent: #ea1f2e;
	--jpfood-accent-dark: #000;
	--jpfood-text: #101010;
	--jpfood-border: #ddd;
	--jpfood-border-light: #eee;
}
.jpfood-menu { color: var(--jpfood-text); margin: 0 0 2rem; }

/* Menu group navigation */
.jpfood-menu-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.jpfood-menu-nav a {
	display: inline-block; padding: .45rem 1rem; border: 1px solid var(--jpfood-border);
	background: #fff; color: var(--jpfood-text); text-decoration: none; font-size: .9rem;
	text-transform: uppercase; letter-spacing: .03em;
}
.jpfood-menu-nav a:hover, .jpfood-menu-nav a.active { background: var(--jpfood-accent); border-color: var(--jpfood-accent); color: #fff; }

/* Menu group section + heading (mnheading-1 style: red underline accent) */
.jpfood-menu-section { margin-bottom: 3rem; }
.jpfood-menu-heading {
	margin: 0 0 1.5rem; font-weight: 400; position: relative;
	border-bottom: 2px solid var(--jpfood-border); padding-bottom: 15px;
}
.jpfood-menu-heading span { position: relative; display: inline-block; }
.jpfood-menu-heading span:after {
	content: ""; position: absolute; left: 0; bottom: -17px; width: 60px; height: 2px;
	background: var(--jpfood-accent);
}
.jpfood-menu-desc { margin-bottom: 1.25rem; color: #666; }

/* ---- Grid layout ---- */
.jpfood-grid { display: grid; gap: 1.5rem 1rem; }
.jpfood-grid.jpfood-cols-1 { grid-template-columns: 1fr; }
.jpfood-grid.jpfood-cols-2 { grid-template-columns: repeat(2, 1fr); }
.jpfood-grid.jpfood-cols-3 { grid-template-columns: repeat(3, 1fr); }
.jpfood-grid.jpfood-cols-4 { grid-template-columns: repeat(4, 1fr); }
.jpfood-grid.jpfood-cols-5 { grid-template-columns: repeat(5, 1fr); }
.jpfood-grid.jpfood-cols-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 960px) {
	.jpfood-grid.jpfood-cols-3, .jpfood-grid.jpfood-cols-4,
	.jpfood-grid.jpfood-cols-5, .jpfood-grid.jpfood-cols-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .jpfood-grid { grid-template-columns: 1fr !important; } }

/* Grid card (reference "style-1") */
.jpfood-item-grid {
	margin: 0; padding: 10px; text-align: center; background: transparent;
	position: relative; transition: all .3s ease;
}
.jpfood-item-grid .jpfood-img {
	position: relative; overflow: hidden; padding: 4px; background: rgba(0,0,0,.05);
}
.jpfood-item-grid .jpfood-img img {
	width: 100%; height: auto; display: block; border: 3px solid #fff;
	transition: transform .3s ease;
}
.jpfood-item-grid:hover .jpfood-img img { transform: scale(1.05); }
.jpfood-item-grid .jpfood-title { margin: 0; font-weight: 400; line-height: 1.1; padding: 15px 0 0; }
.jpfood-item-grid .jpfood-desc { color: #666; font-size: .9rem; margin: .5rem 0 0; }
.jpfood-item-grid .jpfood-actions { margin-top: 1rem; }

/* Red price sitting on a centered rule */
.jpfood-price-rule { position: relative; text-align: center; margin: 1rem 0 .25rem; }
.jpfood-price-rule:before {
	content: ""; position: absolute; top: 50%; left: 15%; right: 15%;
	border-top: 2px solid var(--jpfood-border);
}
.jpfood-item-grid .jpfood-price { position: relative; background: #fff; padding: 0 15px; }
.jpfood-price { font-size: 19px; font-weight: 700; color: var(--jpfood-accent); }
.jpfood-price del { color: #2b2b2b; font-weight: 400; margin-right: 6px; }

.jpfood-badge {
	position: absolute; top: .6rem; left: .6rem; background: var(--jpfood-accent); color: #fff;
	font-size: .72rem; padding: .15rem .55rem; text-transform: uppercase; letter-spacing: .04em;
}

/* ---- List layout (reference "list-1/2") ---- */
.jpfood-list { display: block; }
.jpfood-item-list {
	position: relative; display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px;
}
.jpfood-item-list .jpfood-img { flex: 0 0 auto; }
.jpfood-item-list .jpfood-img img {
	width: 70px; height: 70px; object-fit: cover; display: block;
	border: 1px solid var(--jpfood-border-light); padding: 2px;
}
.jpfood-item-list .jpfood-body { flex: 1; min-width: 0; }
.jpfood-item-list .jpfood-head {
	display: flex; align-items: baseline; gap: 1rem; border-bottom: 1px dashed #bbb; padding-bottom: 6px;
}
.jpfood-item-list .jpfood-title { margin: 0; font-size: 22px; font-weight: 400; }
.jpfood-item-list .jpfood-head .jpfood-price { margin-left: auto; font-size: 22px; }
.jpfood-item-list .jpfood-desc { color: #666; font-size: .95rem; margin: .4rem 0 0; padding-right: 48px; }
.jpfood-item-list .jpfood-actions { position: absolute; top: 4px; right: 0; }

.jpfood-item .jpfood-title a { text-decoration: none; color: inherit; }
.jpfood-item .jpfood-title a:hover { color: var(--jpfood-accent); }
.jpfood-soldout { color: #999; font-style: italic; }
/* WooCommerce appends a "View cart" link after ajax adds; the mini-cart covers that. */
.jpfood-item .added_to_cart { display: none !important; }

/* ---- Round "+" add button ---- */
.jpfood-plus {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; padding: 0; border: 2px solid var(--jpfood-accent);
	background: #fff; border-radius: 50%; cursor: pointer; position: relative;
	transition: background .15s ease; box-shadow: none; line-height: 0; text-indent: 0;
}
.jpfood-plus:hover { background: var(--jpfood-accent); }
.jpfood-plus .jpfood-plus-icon { position: relative; width: 16px; height: 16px; display: block; }
.jpfood-plus .jpfood-plus-icon:before,
.jpfood-plus .jpfood-plus-icon:after {
	content: ""; position: absolute; background: var(--jpfood-accent); transition: background .15s ease;
}
.jpfood-plus .jpfood-plus-icon:before { top: 7px; left: 0; width: 16px; height: 2px; }
.jpfood-plus .jpfood-plus-icon:after { left: 7px; top: 0; width: 2px; height: 16px; }
.jpfood-plus:hover .jpfood-plus-icon:before,
.jpfood-plus:hover .jpfood-plus-icon:after { background: #fff; }
.jpfood-plus.loading { opacity: .6; }

/* Square text button (used in the modal) */
.jpfood-btn.jpfood-textbtn, .jpfood-modal .single_add_to_cart_button {
	background: var(--jpfood-accent); color: #fff; border: 0; border-radius: 0;
	padding: 12px 25px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
	box-shadow: 2px 2px 2px rgba(0,0,0,.2); cursor: pointer;
}
.jpfood-btn.jpfood-textbtn:hover, .jpfood-modal .single_add_to_cart_button:hover { background: #000; color: #fff; }

.jpfood-empty { color: #777; }

/* ---- Modal (reference: 50/50 image + details, round red close) ---- */
.jpfood-modal { position: fixed; inset: 0; z-index: 100000; display: none; }
.jpfood-modal.is-open { display: block; }
.jpfood-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.8); }
.jpfood-modal-content {
	position: relative; z-index: 1; background: #fff; max-width: 900px; width: calc(100% - 2rem);
	margin: 8vh auto; max-height: 84vh; overflow: auto; border-radius: 0;
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.jpfood-modal-close {
	position: absolute; top: -14px; right: -14px; z-index: 9; width: 30px; height: 30px;
	border: 0; border-radius: 50%; background: var(--jpfood-accent); color: #fff;
	font-size: 22px; line-height: 30px; cursor: pointer; box-shadow: 2px 2px 2px rgba(0,0,0,.2);
}
body.jpfood-modal-open { overflow: hidden; }

.jpfood-modal-body { display: flex; flex-wrap: wrap; align-items: stretch; }
.jpfood-modal-media { flex: 1 1 45%; min-width: 260px; }
.jpfood-modal-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jpfood-modal-details { flex: 1 1 45%; min-width: 260px; padding: 25px 30px; }
.jpfood-modal-title { margin: 0 0 1rem; font-size: 27px; position: relative; padding-bottom: 12px; }
.jpfood-modal-title:after { content: ""; position: absolute; left: 0; bottom: 0; width: 50px; height: 3px; background: var(--jpfood-border); }
.jpfood-modal-price { font-size: 20px; font-weight: 700; color: var(--jpfood-accent); border-bottom: 1px solid var(--jpfood-border-light); padding-bottom: 16px; margin-bottom: 16px; }
.jpfood-modal-desc { color: #555; margin-bottom: 1rem; }
@media (max-width: 767px) { .jpfood-modal-media { flex-basis: 100%; } .jpfood-modal-details { flex-basis: 100%; } }

.jpfood-loading { min-height: 160px; }
.jpfood-loading:after {
	content: ""; display: block; width: 32px; height: 32px; margin: 4rem auto;
	border: 3px solid #ddd; border-top-color: var(--jpfood-accent); border-radius: 50%;
	animation: jpfood-spin .8s linear infinite;
}
@keyframes jpfood-spin { to { transform: rotate(360deg); } }

/* ---- Options ---- */
.jpfood-options { margin: 1rem 0; }
.jpfood-optgroup { margin-bottom: 1rem; }
.jpfood-optgroup-title { font-weight: 700; margin-bottom: .35rem; text-transform: uppercase; font-size: .85rem; letter-spacing: .03em; }
.jpfood-choice-label { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; cursor: pointer; border-bottom: 1px dashed var(--jpfood-border-light); }
.jpfood-choice-price { color: var(--jpfood-accent); font-style: normal; margin-left: auto; font-weight: 600; }
.jpfood-select, .jpfood-freeinput { width: 100%; max-width: 340px; padding: .5rem; border: 1px solid var(--jpfood-border); }
.jpfood-options-total { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--jpfood-border-light); padding-top: .6rem; margin: .5rem 0 1rem; }

/* ---- Floating mini cart ---- */
.jpfood-cart-toggle {
	position: fixed; right: 8px; top: 50%; transform: translateY(-50%); z-index: 100001;
	width: 45px; height: 45px; border: 0; border-radius: 0; background: var(--jpfood-accent, #ea1f2e);
	color: #fff; cursor: pointer; box-shadow: 2px 2px 2px rgba(0,0,0,.2); padding: 0;
	display: flex; align-items: center; justify-content: center;
}
.jpfood-cart-toggle svg { width: 20px; height: 20px; fill: #fff; }
.jpfood-cart-count {
	position: absolute; top: -10px; left: -8px; min-width: 20px; height: 20px; line-height: 20px;
	padding: 0 4px; border-radius: 50%; background: #2196F3; border: 1px solid #eee; color: #fff;
	font-size: 10px; text-align: center; box-sizing: border-box;
}
.jpfood-cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: -1; transition: background .3s ease; pointer-events: none; }
.jpfood-cart-overlay.is-open { background: rgba(0,0,0,.7); z-index: 100002; pointer-events: auto; }
.jpfood-cart-panel {
	position: fixed; top: 0; right: 0; width: 300px; max-width: 90vw; height: 100vh; background: #fff;
	z-index: -1; transform: translateX(100%); transition: transform .3s ease, z-index 0s linear .3s;
	box-shadow: -3px 0 50px -2px rgba(0,0,0,.15); display: flex; flex-direction: column;
}
.jpfood-cart-panel.is-open { transform: translateX(0); z-index: 100003; transition: transform .3s ease; }
.jpfood-cart-head {
	display: flex; align-items: center; justify-content: space-between; background: var(--jpfood-accent, #ea1f2e);
	color: #fff; padding: 12px 15px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.jpfood-cart-close { border: 0; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.jpfood-cart-body { flex: 1; overflow-y: auto; padding: 10px 15px 30px; }
.jpfood-cart-body .woocommerce-mini-cart__total { border-top: 2px solid var(--jpfood-border, #ddd); padding: 12px 0; font-size: 1.05rem; }
.jpfood-cart-body .woocommerce-mini-cart__buttons { display: flex; gap: 6px; }
.jpfood-cart-body .woocommerce-mini-cart__buttons a { flex: 1; text-align: center; background: var(--jpfood-accent, #ea1f2e); color: #fff; padding: 8px 10px; border-radius: 0; }
.jpfood-cart-body .woocommerce-mini-cart__buttons a:hover { background: #000; }
.jpfood-cart-empty { color: #777; padding: 1rem 0; }
