/* =============================================================
   ELEKTRO ZA HUBICKU – DETAIL PRODUKTU v1.2
   02.12.2026 | Samostatny CSS modul pro Shoptet
   Nacitat po EZH_detailni_popisy_v1_0.css.
   Bez JS, bez zmen HTML, bez zmen cen a logiky kosiku.
   v1.1: skryti odkazu Tisk a pravy odstup nakupniho bloku.
   v1.2: skryti Tisku i mimo mobilni nakupni blok; jednotny ramecek mnozstvi.
   ============================================================= */

/* 01 – Firemni barvy a nakupni blok
   Třída p-info-wrapper je dolozena dodanym HTML.
   Sirku sloupce ponechavame na Bootstrapu / Shoptetu. */
.p-info-wrapper:has(> .p-final-price-wrapper) {
    --ezh-primary: #00AC97;
    --ezh-primary-dark: #007E74;
    --ezh-dark: #002F30;
    --ezh-light: #F0F7F6;
    --ezh-border: #DCE5E4;
    --ezh-text: #333333;
    --ezh-muted: #666666;
    --ezh-white: #FFFFFF;
    --ezh-radius: 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-width: 0;
    padding: 20px 20px 18px;
    background: var(--ezh-light);
    border-radius: var(--ezh-radius);
    color: var(--ezh-text);
}

/* 02 – Kratky popis pred cenou. Odkaz na detail zachovan. */
.p-info-wrapper > .p-short-description {
    order: -30;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ezh-text, #333333);
}
.p-info-wrapper > .p-short-description p { margin: 0 0 8px; }
.p-info-wrapper > .p-short-description p:last-child { margin-bottom: 0; }
.p-info-wrapper > p[data-testid="productCardDescr"] {
    order: -29;
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 1.4;
}
.p-info-wrapper > p[data-testid="productCardDescr"] a {
    color: var(--ezh-primary-dark, #007E74);
}

/* 03 – Cena, DPH, případne dalsi nativni cenove udaje */
.p-info-wrapper > .p-final-price-wrapper {
    order: -20;
    margin: 16px 0 12px;
    padding: 21px 0 0;
    border-top: 1px solid var(--ezh-border, #DCE5E4);
    border-bottom: 0;
}
.p-info-wrapper:not(:has(> .p-short-description, > p[data-testid="productCardDescr"])) > .p-final-price-wrapper {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.p-info-wrapper .p-final-price-wrapper .price-final {
    display: block;
    margin: 0 0 3px;
    font-size: clamp(30px, 2.5vw, 36px);
    line-height: 1.2;
    font-weight: 700;
    color: #172424;
    overflow-wrap: anywhere;
}
.p-info-wrapper .p-final-price-wrapper .price-final-holder {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
.p-info-wrapper .p-final-price-wrapper .price-additional {
    display: block;
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--ezh-muted, #666666);
}
.p-info-wrapper .p-final-price-wrapper .price-measure {
    color: var(--ezh-muted, #666666);
    font-size: 13px;
}

/* 04 – Dostupnost. Barvu stavu urcuje Shoptet.
   Fajfku zobrazit jen u dolozeneho zeleneho stavu. */
.p-info-wrapper > .availability-value {
    order: -10;
    margin: 2px 0 13px;
    padding: 0;
    font-size: 18px;
    line-height: 1.45;
    font-weight: 700;
}
.p-info-wrapper .availability-value .availability-label { font-weight: 700; }
.p-info-wrapper .availability-value .availability-amount {
    font-weight: 700;
    font-size: inherit;
}
.p-info-wrapper .availability-label[style*="#3c840f" i]::before {
    content: "\2713";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: 2px;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 50%;
    background: #3C840F;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.p-info-wrapper .availability-value:has(> .availability-label[style*="#3c840f" i]) .availability-amount {
    color: #3C840F;
}

/* 05 – Doruceni: pouze tabulka uvnitr nakupniho bloku.
   Neprepisovat ostatni radky (napr. varianty). */
.p-info-wrapper > table.detail-parameters {
    order: -5;
    width: 100%;
    margin: 0 0 16px;
}
.p-info-wrapper > table.detail-parameters:has(.delivery-time-label) {
    border: 0;
    background: transparent;
}
.p-info-wrapper > table.detail-parameters tr:has(.delivery-time-label) > td {
    position: relative;
    padding: 0 0 0 34px;
    border: 0;
    background: transparent;
    text-align: left;
    vertical-align: middle;
    line-height: 1.45;
}
.p-info-wrapper .delivery-time-label {
    display: block;
    margin: 0 0 2px;
    color: var(--ezh-muted, #666666);
    font-weight: 400;
    font-size: 15px;
}
.p-info-wrapper > table.detail-parameters tr:has(.delivery-time-label) > td::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    pointer-events: none;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007E74' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5h13v13H1.5zM14.5 9h4l4 4v5h-8'/%3E%3Ccircle cx='6' cy='18' r='2.5' fill='%23F0F7F6'/%3E%3Ccircle cx='18.5' cy='18' r='2.5' fill='%23F0F7F6'/%3E%3C/svg%3E");
}
.p-info-wrapper .delivery-time {
    display: block;
    margin: 0;
    color: #172424;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

/* 06 – Mnozstvi a nakupni tlacitko.
   Nativni input, plus/minus, tooltipy, submit a disabled zustavaji. */
.p-info-wrapper > .add-to-cart {
    order: 10;
}
.p-info-wrapper > .add-to-cart:has(> .add-to-cart-button):not(.hidden):not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 22px;
    padding: 0;
}
/* Jeden souvisly ramecek na obalu; input a sipky bez vlastniho
   vnejsiho ramecku. Nativni ovladaci prvky a tooltipy zachovany. */
.p-info-wrapper .add-to-cart > .quantity {
    position: relative;
    display: block;
    flex: 0 0 80px;
    align-self: stretch;
    box-sizing: border-box;
    min-height: 58px;
    height: 58px;
    width: 80px;
    margin: 0;
    padding: 0;
    border: 1px solid #C4CFCE !important;
    border-radius: 7px;
    background: #FFFFFF;
    overflow: visible;
}
.p-info-wrapper .add-to-cart > .quantity > label {
    display: block;
    box-sizing: border-box;
    width: calc(100% - 22px);
    height: 100%;
    margin: 0;
    padding: 0;
}
.p-info-wrapper .add-to-cart .quantity input.amount {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 8px;
    border: 0 !important;
    border-radius: 6px 0 0 6px;
    background: #FFFFFF;
    box-shadow: none;
    font-size: 16px;
    text-align: right;
    appearance: textfield;
    -moz-appearance: textfield;
}
.p-info-wrapper .add-to-cart .quantity input.amount::-webkit-inner-spin-button,
.p-info-wrapper .add-to-cart .quantity input.amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.p-info-wrapper .add-to-cart .quantity > :is(button.increase, button.decrease) {
    position: absolute;
    box-sizing: border-box;
    right: 0;
    left: auto;
    width: 22px;
    height: 50%;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-left: 1px solid var(--ezh-border, #DCE5E4) !important;
    background-color: #F7F9F9;
    box-shadow: none;
}
.p-info-wrapper .add-to-cart .quantity > button.increase {
    top: 0;
    bottom: auto;
    border-bottom: 1px solid var(--ezh-border, #DCE5E4) !important;
    border-radius: 0 6px 0 0;
}
.p-info-wrapper .add-to-cart .quantity > button.decrease {
    top: auto;
    bottom: 0;
    border-radius: 0 0 6px 0;
}
.p-info-wrapper .add-to-cart .quantity:focus-within {
    border-color: var(--ezh-primary-dark, #007E74) !important;
    box-shadow: 0 0 0 1px var(--ezh-primary-dark, #007E74);
}
.p-info-wrapper .add-to-cart > .add-to-cart-button {
    flex: 1 1 180px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    min-height: 58px;
    height: auto;
    margin: 0;
    padding: 13px 15px;
    border: 1px solid var(--ezh-primary-dark, #007E74);
    border-radius: 7px;
    background: var(--ezh-primary-dark, #007E74);
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    white-space: normal;
    text-align: center;
    transition: background-color .18s ease, border-color .18s ease;
}
/* Vlastni ikona jen na skutecnem tlacitku, nahrazuje sipku sablony. */
.p-info-wrapper .add-to-cart > .add-to-cart-button::before {
    content: "";
    display: inline-block;
    position: static;
    vertical-align: -4px;
    width: 22px;
    height: 22px;
    margin: 0 9px 0 0;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h3l3 13h11l3-10H6'/%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3C/svg%3E");
    border: 0;
    transform: none;
    pointer-events: none;
}
.p-info-wrapper .add-to-cart > .add-to-cart-button:not(:disabled):not(.disabled):not([aria-disabled="true"]):hover {
    background: #006C63;
    border-color: #006C63;
    color: #FFFFFF;
}
.p-info-wrapper .add-to-cart > .add-to-cart-button:focus-visible {
    outline: 2px solid #002F30;
    outline-offset: 3px;
}
.p-info-wrapper .add-to-cart > .add-to-cart-button:is(:disabled, .disabled, [aria-disabled="true"]) {
    opacity: .55;
    cursor: not-allowed;
}

/* 07 – Dotaz: odkaz Tisk je skryty pouze v detailu produktu. */
.p-info-wrapper > .social-buttons-wrapper {
    order: 20;
    margin: 0;
    padding: 15px 0 0;
    border-top: 1px solid var(--ezh-border, #DCE5E4);
}
.p-info-wrapper .social-buttons-wrapper .link-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin: 0;
}
.p-info-wrapper .link-icons > a.chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.4;
    text-transform: none;
    color: var(--ezh-primary-dark, #007E74);
}
.p-info-wrapper .social-buttons-wrapper .link-icons > a.print {
    display: none !important;
}
.p-info-wrapper .link-icons > a.chat::before {
    position: static;
    display: inline-block;
    margin: 0;
    font-size: 17px;
    line-height: 1;
    transform: none;
}
.p-info-wrapper .link-icons > a.chat > span { text-transform: none; }

/* 08 – Doplnkove parametry (mimo p-info-wrapper a mimo doruceni).
   Struktura spodni tabulky nebyla dodana: bezpecny selektor
   pro tabulku s th/td a volitelny obal s nadpisem.
   Skryte radky, napr. hmotnost, zustavaji skryte. */
:is(body.type-detail, .p-detail) table.detail-parameters:not(.p-info-wrapper table):not(:has(.delivery-time-label, [data-testid="deliveryTime"])):has(th) {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    background: #F0F7F6;
    border: 0;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    line-height: 1.5;
}
/* Kartu i s nadpisem vytvorit jen kdyz jsou nadpis a tabulka
   primymi detmi stejneho obalu, nikoli na celem detailu. */
:is(body.type-detail, .p-detail) :is(div, section, aside):not(.p-info-wrapper, .p-info-wrapper *):has(> :is(h2,h3,h4)):has(> table.detail-parameters th):not(:has(> table.detail-parameters .delivery-time-label, > table.detail-parameters [data-testid="deliveryTime"])):not(:has(> .ezh-product-description, > .description-inner, > .p-info-wrapper, > .p-detail-inner)) {
    box-sizing: border-box;
    padding: 17px 15px 10px;
    background: #F0F7F6;
    border-radius: 10px;
    align-self: flex-start;
    min-width: 0;
}
:is(body.type-detail, .p-detail) :is(div, section, aside):not(.p-info-wrapper, .p-info-wrapper *):has(> table.detail-parameters th):not(:has(> table.detail-parameters .delivery-time-label, > table.detail-parameters [data-testid="deliveryTime"])) > :is(h2,h3,h4) {
    margin: 0 0 8px;
    color: #002F30;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
}
:is(body.type-detail, .p-detail) table.detail-parameters:not(.p-info-wrapper table):not(:has(.delivery-time-label, [data-testid="deliveryTime"])):has(th) :is(th,td) {
    padding: 17px 10px;
    border: 0;
    border-bottom: 1px solid #DCE5E4;
    background: transparent;
    vertical-align: middle;
    overflow-wrap: anywhere;
    white-space: normal;
}
:is(body.type-detail, .p-detail) table.detail-parameters:not(.p-info-wrapper table):not(:has(.delivery-time-label, [data-testid="deliveryTime"])):has(th) th {
    width: 46%;
    text-align: left;
    font-weight: 400;
    color: #666666;
}
:is(body.type-detail, .p-detail) table.detail-parameters:not(.p-info-wrapper table):not(:has(.delivery-time-label, [data-testid="deliveryTime"])):has(th) td {
    text-align: right;
    color: #002F30;
    font-size: 15px;
    font-weight: 700;
}
:is(body.type-detail, .p-detail) table.detail-parameters:not(.p-info-wrapper table):not(:has(.delivery-time-label, [data-testid="deliveryTime"])):has(th) td a { color: #007E74; }
:is(body.type-detail, .p-detail) table.detail-parameters:not(.p-info-wrapper table):not(:has(.delivery-time-label, [data-testid="deliveryTime"])):has(th) tr:last-child > :is(th,td) { border-bottom: 0; }

/* 09 – Responzivita (puvodni sirky sloupcu beze zmeny) */
@media (max-width: 991px) {
    .p-info-wrapper:has(> .p-final-price-wrapper) { padding: 18px 16px; }
}
@media (max-width: 767px) {
    .p-info-wrapper:has(> .p-final-price-wrapper) { padding: 17px 15px; border-radius: 8px; }
    .p-info-wrapper > .p-short-description { font-size: 15px; }
    .p-info-wrapper .p-final-price-wrapper .price-final { font-size: 30px; }
    .p-info-wrapper .add-to-cart > .add-to-cart-button { font-size: 16px; min-height: 54px; flex-basis: 145px; }
    .p-info-wrapper .add-to-cart > .quantity { min-height: 54px; height: 54px; }
    :is(body.type-detail, .p-detail) table.detail-parameters:not(.p-info-wrapper table):not(:has(.delivery-time-label, [data-testid="deliveryTime"])):has(th) :is(th,td) { padding: 13px 8px; font-size: 14px; }
}
@media (max-width: 360px) {
    .p-info-wrapper .add-to-cart > .add-to-cart-button { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .p-info-wrapper .add-to-cart > .add-to-cart-button { transition: none; }
}

/* 10 – Bily odstup od praveho okraje.
   Prusvitny okraj zachova sirku Bootstrap sloupce a nevyvola
   zalomeni druheho sloupce. Pozadi konci pred pravym okrajem. */
.p-info-wrapper:has(> .p-final-price-wrapper) {
    border-right: 16px solid transparent;
    background-clip: padding-box;
    border-top-right-radius: 26px 10px;
    border-bottom-right-radius: 26px 10px;
}
@media (max-width: 767px) {
    .p-info-wrapper:has(> .p-final-price-wrapper) {
        border-right-width: 8px;
        border-top-right-radius: 16px 8px;
        border-bottom-right-radius: 16px 8px;
    }
}

/* 11 – Tisk: i mobilni presunuta nebo duplicitni sada akci.
   Pouze detail produktu, nikdy tisk objednavek nebo dokladu. */
body.type-detail a.link-icon.print,
body.type-detail .link-icons .print,
body.type-detail [data-testid="productDetailActionIcons"] .print,
body.type-detail a[title="Tisknout produkt"],
.p-detail a.link-icon.print,
.p-info-wrapper a.link-icon.print,
[data-testid="productDetailActionIcons"] a.print {
    display: none !important;
}
