/* ==========================================================================
   One Page Cracker Shop — Brand palette
   ========================================================================== */
:root {
	--opcs-primary: #6A4FB3;       /* Royal Purple */
	--opcs-primary-dark: #51348E;  /* Deep Purple */
	--opcs-secondary: #C64FA5;     /* Magenta Pink */
	--opcs-accent: #FFC83D;        /* Golden Yellow */
	--opcs-success: #22C55E;
	--opcs-warning: #F59E0B;
	--opcs-error: #EF4444;
	--opcs-bg-row: #F8F3FF;
	--opcs-border: #E4D9F7;
	--opcs-text: #2B1E44;
}

#opcs-app { font-family: inherit; color: var(--opcs-text); max-width: 1400px; margin: 0 auto; position: relative; }
#opcs-app * { box-sizing: border-box; }

/* Top bar */
.opcs-topbar {
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	background: linear-gradient(90deg, var(--opcs-primary), var(--opcs-secondary));
	padding: 12px 18px; border-radius: 10px 10px 0 0; color: #fff;
	position: sticky; top: 0; z-index: 500; box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.opcs-category-select select {
	padding: 8px 12px; border-radius: 6px; border: none; font-weight: 600; color: var(--opcs-primary-dark);
}
.opcs-search-input {
	flex: 1 1 220px; min-width: 160px; padding: 8px 12px; border-radius: 6px; border: none;
}
.opcs-totals { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.opcs-total-pill {
	background: rgba(255,255,255,0.15); padding: 6px 12px; border-radius: 20px; font-size: 13px;
}
.opcs-total-pill strong { color: var(--opcs-accent); margin-left: 4px; }
.opcs-cart-icon {
	background: var(--opcs-accent); color: var(--opcs-primary-dark); border: none; border-radius: 20px;
	padding: 8px 16px; font-weight: 700; cursor: pointer; font-size: 15px;
}

/* Category + rows */
.opcs-category-header {
	background: linear-gradient(90deg, var(--opcs-secondary), var(--opcs-primary));
	color: #fff; text-align: center; font-weight: 700; letter-spacing: .5px;
	padding: 10px; margin-top: 18px; border-radius: 6px;
}
.opcs-row {
	display: grid;
	grid-template-columns: 70px 2.5fr 0.8fr 0.9fr 0.9fr 0.9fr 1fr;
	align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--opcs-border);
}
.opcs-row-head { background: var(--opcs-bg-row); font-weight: 700; font-size: 13px; color: var(--opcs-primary-dark); }
.opcs-product-row:hover { background: #FBF6FF; }
.opcs-col-img img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid var(--opcs-border); }
.opcs-strike { text-decoration: line-through; color: #999; font-size: 13px; }
.opcs-col-sale { font-weight: 700; color: var(--opcs-primary-dark); }
.opcs-qty-input {
	width: 100%; padding: 6px; border: 1px solid var(--opcs-border); border-radius: 6px; text-align: center;
}
.opcs-row-total {
	width: 100%; padding: 6px; border: 1px solid var(--opcs-border); border-radius: 6px; text-align: center;
	background: #F0EBFB; font-weight: 700; color: var(--opcs-primary-dark);
}
.opcs-empty-msg { text-align: center; padding: 40px; color: #888; }

/* Check order button */
.opcs-check-order-btn {
	position: sticky; bottom: 0; left: 0; width: 100%; max-width: none;
	margin: 24px 0 0; border-radius: 0; padding: 16px; font-size: 16px;
	box-shadow: 0 -3px 10px rgba(0,0,0,0.2); z-index: 500;
}

.opcs-btn-primary {
	background: var(--opcs-primary); color: #fff; border: none; border-radius: 6px;
	padding: 12px 20px; font-weight: 700; cursor: pointer; font-size: 15px; width: 100%;
}
.opcs-btn-primary:hover { background: var(--opcs-primary-dark); }
.opcs-btn-secondary {
	background: #fff; color: var(--opcs-primary); border: 2px solid var(--opcs-primary); border-radius: 6px;
	padding: 10px 20px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 8px;
}
.opcs-btn-confirm {
	background: var(--opcs-accent); color: var(--opcs-primary-dark); border: none; border-radius: 6px;
	padding: 12px 20px; font-weight: 800; cursor: pointer; width: 100%; margin: 10px 0; font-size: 15px;
}
.opcs-btn-confirm:hover { filter: brightness(0.95); }

/* Overlay */
#opcs-overlay {
	position: fixed; inset: 0; background: rgba(43,30,68,0.55); display: none; z-index: 9998;
}
#opcs-overlay.opcs-active { display: block; }

/* Quick view modal */
.opcs-modal { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; }
.opcs-modal.opcs-active { display: flex; }
.opcs-modal-content {
	background: #fff; border-radius: 12px; padding: 24px; width: 320px; text-align: center; position: relative;
	border-top: 6px solid var(--opcs-primary);
}
.opcs-modal-close {
	position: absolute; top: 8px; right: 12px; border: none; background: none; font-size: 22px; cursor: pointer; color: var(--opcs-primary-dark);
}
#opcs-qv-image { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
#opcs-qv-name { margin: 6px 0; color: var(--opcs-primary-dark); }
#opcs-qv-price { font-weight: 700; color: var(--opcs-secondary); font-size: 18px; }
.opcs-qv-qty-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0; }
.opcs-qv-qty-row button {
	width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--opcs-primary); color: #fff; font-size: 18px; cursor: pointer;
}
.opcs-qv-qty-row input { width: 60px; text-align: center; padding: 6px; border-radius: 6px; border: 1px solid var(--opcs-border); }

/* Estimate side panel */
.opcs-sidebar {
	position: fixed; top: 0; right: -400px; width: 380px; max-width: 92vw; height: 100vh; background: #fff;
	box-shadow: -4px 0 24px rgba(0,0,0,0.2); z-index: 9999; transition: right .3s ease; overflow-y: auto;
}
.opcs-sidebar.opcs-active { right: 0; }
.opcs-sidebar-header {
	background: linear-gradient(90deg, var(--opcs-primary), var(--opcs-secondary)); color: #fff;
	padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
}
.opcs-sidebar-header h3 { margin: 0; font-size: 17px; }
.opcs-sidebar-close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

.opcs-estimate-items { padding: 10px 18px; }
.opcs-estimate-item {
	display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--opcs-border);
}
.opcs-estimate-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.opcs-estimate-item .opcs-ei-name { flex: 1; font-size: 13px; font-weight: 600; }
.opcs-estimate-item .opcs-ei-qty { font-size: 12px; color: #777; }
.opcs-estimate-item .opcs-ei-total { font-weight: 700; color: var(--opcs-primary-dark); }
.opcs-estimate-item .opcs-ei-remove { color: var(--opcs-error); cursor: pointer; font-weight: 700; margin-left: 6px; }

.opcs-sidebar-summary { padding: 6px 18px; }
.opcs-summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.opcs-summary-row strong { color: var(--opcs-primary-dark); }
.opcs-summary-final { border-top: 2px dashed var(--opcs-border); font-size: 16px; font-weight: 800; margin-top: 4px; }
.opcs-summary-final strong { color: var(--opcs-secondary); }

.opcs-min-order-note { padding: 10px 18px 24px; }
.opcs-min-order-note p { color: var(--opcs-error); font-weight: 700; margin: 6px 0; }
.opcs-min-order-note ul { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.opcs-min-order-note li { display: flex; justify-content: space-between; padding: 3px 0; }

#opcs-confirm-estimate-btn { margin: 0 18px; width: calc(100% - 36px); }

.opcs-form-view { padding: 10px 18px 30px; }
.opcs-form-view label { display: block; font-size: 12px; font-weight: 700; margin: 10px 0 4px; color: var(--opcs-primary-dark); }
.opcs-form-view input, .opcs-form-view select, .opcs-form-view textarea {
	width: 100%; padding: 9px 10px; border: 1px solid var(--opcs-border); border-radius: 6px; font-size: 14px;
}
.opcs-form-error { color: var(--opcs-error); font-size: 13px; font-weight: 700; margin: 10px 0; }

@media (max-width: 720px) {
	.opcs-row { grid-template-columns: 50px 2fr 0.7fr 0.9fr 0.9fr; }
	.opcs-col-total { display: none; }
	.opcs-totals { order: 3; width: 100%; }
}
