/* Mygrafistas product page (loaded by «Mygrafistas: συντήρηση» on product pages only). */

/* Options (colour, print size, file) before the quantity / cart row instead of after it. */
#product.product-details > .product-options { order: 0; }

/* Journal3 sets pointer-events:none on the whole price group; give clicks back to the picker and the table. */
#product .product-price-group .mg-qty, #product .product-price-group .mg-qty *,
#product .product-price-group .discounts, #product .product-price-group .discounts * { pointer-events: auto; }

/* Price table: full width of the column, rows pickable. */
#product .product-price-group .price-wrapper { width: 100%; }
#product .discounts, #product .discounts .table-responsive { width: 100%; }
#product .discounts table.table { width: 100%; margin-bottom: 0; }
#product .discounts tr.product-discount { cursor: pointer; transition: background-color .15s ease; }
#product .discounts tr.product-discount:hover td { background-color: #f3f4f6; }
#product .discounts tr.product-discount.mg-active td { background-color: #fdecec; color: #111; font-weight: 600; }
#product .discounts tr.product-discount:focus-visible { outline: 2px solid #dd0000; outline-offset: -2px; }

/* Quantity picker above the price table. */
.mg-qty { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.mg-qty label { margin: 0; font-size: 14px; color: #111; font-weight: 600; }
.mg-qty-box { display: inline-flex; align-items: stretch; height: 42px; border: 1px solid #ccc; border-radius: 3px; overflow: hidden; background: #fff; }
.mg-qty-box button { width: 42px; border: 0; background: #f3f4f6; color: #111; font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.mg-qty-box button:hover { background: #e5e7eb; }
.mg-qty-box button:active { background: #d1d5db; }
.mg-qty-box input { width: 72px; border: 0; border-left: 1px solid #ccc; border-right: 1px solid #ccc; text-align: center; font-size: 16px; color: #111; -moz-appearance: textfield; }
.mg-qty-box input::-webkit-outer-spin-button, .mg-qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mg-qty-note { font-size: 13px; color: #555; }

/* File upload: a drop area (grey, dashed, icon above the text), not a second cart button. */
#product .product-option-file button[id^="button-upload"] {
	background: #eef0f3; color: #111; border: 2px dashed #9ca3af; border-radius: 4px;
	min-height: 132px; padding: 18px 16px; font-size: 15px; letter-spacing: 0; text-transform: none; box-shadow: none;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; line-height: 1.3;
	transition: background-color .15s ease, border-color .15s ease;
}
#product .product-option-file button[id^="button-upload"]:hover,
#product .product-option-file.mg-drag button[id^="button-upload"] { background: #dfe3e8; border-color: #6b7280; color: #111; }
#product .product-option-file button[id^="button-upload"] .fa-upload { font-size: 30px; }
#product .product-option-file .mg-drop-hint { font-size: 13px; color: #4b5563; }
#product .product-option-file.mg-uploaded button[id^="button-upload"] { border-style: solid; border-color: #16a34a; background: #f0fdf4; }
.mg-upload-ok { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px; background: #f0fdf4; color: #14532d; border-radius: 3px; font-size: 14px; }
.mg-upload-ok .mg-check { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #16a34a; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.mg-upload-ok b { font-weight: 600; word-break: break-all; }

/* «Αγορά τώρα» shows the order total. */
#product .mg-buy-total { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Units in the price table («τμχ 10 - 12», «3,50€ / τμχ»). CSS, because the theme rewrites the cells. */
#product .discounts tr.product-discount td:first-child::before { content: "τμχ "; color: #6b7280; font-size: .9em; }
#product .discounts tr.product-discount td:last-child::after { content: " / τμχ" "\A" attr(data-mg-gross); white-space: pre; color: #6b7280; font-size: .9em; line-height: 1.6; }

/* Upload area: grey in every state, never the theme's red. */
#product .product-option-file button[id^="button-upload"]:hover,
#product .product-option-file button[id^="button-upload"]:focus,
#product .product-option-file button[id^="button-upload"]:active,
#product .product-option-file.mg-drag button[id^="button-upload"] {
	background: #dfe3e8 !important; color: #111 !important; border-color: #6b7280 !important; box-shadow: none !important;
}
#product .product-option-file button[id^="button-upload"]:hover *,
#product .product-option-file button[id^="button-upload"]:focus * { color: #111 !important; }
#product .product-option-file button[id^="button-upload"]:hover .mg-drop-hint { color: #374151 !important; }
#product .product-option-file.mg-uploaded button[id^="button-upload"]:hover { background: #e3f6e9 !important; border-color: #16a34a !important; }

/* Price breakdown above the cart buttons. */
.mg-breakdown { margin: 8px 0 12px; padding: 10px 14px; background: #f6f7f9; border-radius: 4px; font-size: 14px; color: #111; }
.mg-bd-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.mg-bd-row span:first-child { color: #4b5563; }
.mg-bd-extra span:first-child { padding-left: 12px; }
.mg-bd-total { margin-top: 4px; padding-top: 7px; border-top: 1px solid #e5e7eb; font-weight: 700; font-size: 15px; }
.mg-bd-total span:first-child { color: #111; }

/* «Προσφορά χωρίς δέσμευση» guide under the product photos. */
.mg-offer-guide { margin: 24px 0 8px; padding: 18px 20px; background: #f6f7f9; border-radius: 4px; color: #111; }
.mg-offer-guide h3 { margin: 0 0 12px; font-size: 17px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.mg-offer-guide ol { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: mg-step; }
.mg-offer-guide li { counter-increment: mg-step; position: relative; padding: 0 0 10px 36px; font-size: 14px; line-height: 1.45; }
.mg-offer-guide li::before { content: counter(mg-step); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; background: #111; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.mg-offer-guide a { font-size: 14px; font-weight: 600; color: #111; text-decoration: underline; text-underline-offset: 3px; }

/* Phones: the guide becomes a link that opens it in a popup. */
.mg-offer-open { display: none; position: relative; z-index: 2; pointer-events: auto; width: 100%; background: #f6f7f9; border: 1px dashed #c4c8ce; border-radius: 4px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px; font-weight: 600; color: #111; text-align: left; cursor: pointer; }
.mg-offer-open span { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.mg-offer-open:active { background: #eef0f3; }
.mg-offer-dialog { border: 0; border-radius: 8px; padding: 22px 20px 18px; width: min(92vw, 420px); color: #111; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.mg-offer-dialog::backdrop { background: rgba(17, 17, 17, .45); }
.mg-offer-dialog h3 { margin: 0 32px 14px 0; font-size: 18px; font-weight: 700; }
.mg-offer-dialog ol { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: mg-step; }
.mg-offer-dialog li { counter-increment: mg-step; position: relative; padding: 0 0 12px 36px; font-size: 15px; line-height: 1.45; }
.mg-offer-dialog li::before { content: counter(mg-step); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; background: #111; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.mg-offer-dialog .mg-guide-more { font-size: 15px; font-weight: 600; color: #111; text-decoration: underline; text-underline-offset: 3px; }
.mg-dialog-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 26px; line-height: 1; color: #111; cursor: pointer; }
@media (max-width: 767px) {
	.mg-offer-guide { display: none; }
	.mg-offer-open { display: block; }
}

/* «Σχετικά προϊόντα / Αγόρασαν επίσης» (Journal3 module 253) hidden on product pages.
   Its images are lazy, so hidden also means never downloaded. Still shown at checkout. */
.route-product-product .module-products-253 { display: none !important; }

/* YouTube thumbnail until clicked. */
.mg-yt, .mg-yt-frame { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: pointer; overflow: hidden; border-radius: 4px; }
.mg-yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; transition: opacity .15s ease; }
.mg-yt:hover img { opacity: 1; }
.mg-yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: rgba(17,17,17,.85); }
.mg-yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.mg-yt:hover .mg-yt-play { background: #dd0000; }

/* Option dropdowns: wide enough for «(+0,30€ χωρίς ΦΠΑ · +0,37€ με ΦΠΑ)». */
#product .product-options .product-option-select select.form-control { width: 100%; max-width: 100%; }

#product-product .mg-notices { margin: 16px 0; }
#product-product .mg-notices .alert { margin: 0 0 8px; }
#product-product .mg-notices .alert:last-child { margin-bottom: 0; }
@media (max-width: 767px) { #product .extra-group .btn-extra { margin-left: 0 !important; width: 100%; } }
