/**
 * Frontend CSS pro TM Eshop
 *
 * @package TM_Eshop
 * @since 1.0.0
 */

/* Obecné styly */
.tm-eshop-container {
    margin-bottom: 20px;
}

/* Styly pro toggle box budou načteny v modulu toggle-box */

/* Úpravy pro stránku pokladny */
/* Oprava vertikálního zarovnání vstupních polí a plovoucích popisků */
.woocommerce-checkout .wc-block-components-text-input input,
.wc-block-checkout__main .wc-block-components-text-input input {
    margin-top: 6px !important; /* Přidáno pro správné vertikální zarovnání */
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.woocommerce-checkout .wc-block-components-text-input label,
.wc-block-checkout__main .wc-block-components-text-input label {
    top: 50% !important;
    transform: translateY(-50%) !important;
    line-height: 1.2 !important;
}

.woocommerce-checkout .wc-block-components-text-input.is-active label,
.wc-block-checkout__main .wc-block-components-text-input.is-active label {
    transform: translateY(-100%) scale(0.75) !important;
    top: 8px !important;
}

/* Skrytí políčka pro výběr země/oblasti v sekci doručovací adresy */
.woocommerce-checkout #shipping_country_field,
.woocommerce-checkout .woocommerce-shipping-fields #shipping_country_field,
.woocommerce-checkout .shipping_address #shipping_country_field,
.woocommerce-checkout .woocommerce-shipping-fields .form-row[id*="shipping_country"],
.woocommerce-checkout p[id*="shipping_country_field"],
.woocommerce-checkout .form-row-wide[id*="shipping_country"],
.woocommerce-checkout label[for*="shipping_country"],
.woocommerce-checkout select[id*="shipping_country"],
.woocommerce-checkout .select2-container--default[aria-labelledby*="select2-shipping_country"] {
    display: none !important;
}

/* Skrytí celé sekce doručovací adresy */
.woocommerce-checkout .woocommerce-shipping-fields {
    display: none !important;
}

/* Styly pro přesun telefonního pole z fakturačních údajů do kontaktních údajů */
/* Skrytí původního telefonního pole v sekci fakturačních údajů */
body.tm-move-phone-enabled .woocommerce-checkout #billing_phone_field,
body.tm-move-phone-enabled .woocommerce-checkout .wc-block-components-address-form #billing_phone_field,
body.tm-move-phone-enabled .woocommerce-checkout .wc-block-components-checkout-step--billing-address .wc-block-components-text-input[name="billing_phone"],
body.tm-move-phone-enabled .woocommerce-checkout .wc-block-components-checkout-step--billing-address label[for="billing_phone"],
body.tm-move-phone-enabled .woocommerce-checkout .wc-block-components-checkout-step--billing-address .wc-block-components-form-row:has(input[name="billing_phone"]) {
    display: none !important;
}

/* Styly pro nové telefonní pole v kontaktních údajích */
.woocommerce-checkout .contact-phone-field {
    margin-top: 15px;
    width: 100%;
}

.woocommerce-checkout .contact-phone-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.woocommerce-checkout .contact-phone-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Hover a focus stavy pro lepší UX */
.woocommerce-checkout .contact-phone-field input:hover {
    border-color: #aaa;
}

.woocommerce-checkout .contact-phone-field input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/**
 * Styly pro košík WooCommerce
 */

/* Minimální styly pro přeškrtnuté ceny - umožňují nastavení v Gutenberg editoru */
.wc-block-components-product-price del,
.price del,
.woocommerce-Price-amount del {
    display: inline-block !important; /* Pouze zajistíme, že budou viditelné */
    margin-right: 5px !important;     /* Malý odstup od aktuální ceny */
}

.wc-block-components-product-price ins,
.price ins,
.woocommerce-Price-amount ins {
    display: inline-block !important; /* Pouze zajistíme, že budou viditelné */   
}



/* Skrytí bloků "UŠETŘENO" v košíku - pouze přesné selektory */
.wc-block-components-product-badge.wc-block-components-sale-badge {
    display: none !important;
}

/* Úprava zobrazení položky v košíku do řádku */
.wc-block-cart-item__wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Úprava názvu produktu */
.wc-block-components-product-name {
    flex: 1;
    min-width: 200px;
    margin-right: 15px;
}

/* Úprava ceny produktu */
.wc-block-cart-item__prices {
    flex: 0 0 auto;
    margin-right: 15px;
}

/* Úprava metadat produktu */
.wc-block-components-product-metadata {
    flex: 0 0 100%;
    order: 4;
}

/* Úprava množství produktu */
.wc-block-cart-item__quantity {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Úprava tlačítek pro odstranění položky - společné vlastnosti */
.wc-block-cart-item__remove-link,
button.wc-block-cart-item__remove-link,
a.remove,
a.remove_from_cart_button,
.cart a.remove,
a[href*="remove_item"],
a.remove_item,
button[aria-label*="Odstranit"] {
    color: transparent !important;
    font-size: 0 !important;
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-indent: -9999px !important;
    text-decoration: none !important;
}

/* Hover stav pro tlačítka odstranění */
.wc-block-cart-item__remove-link:hover,
button.wc-block-cart-item__remove-link:hover,
a.remove:hover,
a.remove_from_cart_button:hover,
.cart a.remove:hover,
a[href*="remove_item"]:hover,
a.remove_item:hover,
button[aria-label*="Odstranit"]:hover {
    opacity: 1;
    background: transparent !important;
}

/* Křížek pro tlačítka odstranění */
.wc-block-cart-item__remove-link:before,
button.wc-block-cart-item__remove-link:before,
a.remove:before,
a.remove_from_cart_button:before,
.cart a.remove:before,
a[href*="remove_item"]:before,
a.remove_item:before,
button[aria-label*="Odstranit"]:before {
    content: "×";
    font-size: 20px;
    line-height: 1;
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #cc0000;
    text-indent: 0;
}

/* Vylepšení vzhledu košíku */
.wc-block-cart__submit-container {
    margin-top: 20px;
}

/* Tlačítko "Koupit SIM" */
.buy-sim-button {
    display: block !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    text-align: center !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    background-color: #dcdcdc !important;
    color: #333 !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    transition: background-color 0.3s ease !important;
    cursor: pointer !important;
}

.buy-sim-button:hover {
    background-color: #e0e0e0 !important;
    color: #000 !important;
}

/* Zajištění správného zobrazení tlačítka v kontejneru */
.wc-block-cart__submit-container .buy-sim-button {
    margin-top: 15px !important;
    display: block !important;
}

.wc-block-cart__submit-button {
    background-color: #1e3a8a !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    transition: background-color 0.3s ease !important;
}

.wc-block-cart__submit-button:hover {
    background-color: #152a60 !important;
}

/* Vylepšení tlačítek pro změnu množství */
.wc-block-components-quantity-selector {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: #f8fafc;
    padding: 2px;
    width: auto;
    height: 30px;
    max-width: 100px;
}

.wc-block-components-quantity-selector__input {
    width: 30px !important;
    height: 24px !important;
    font-size: 14px !important;
    text-align: center !important;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    appearance: textfield !important;
    -moz-appearance: textfield !important;
}

.wc-block-components-quantity-selector__input::-webkit-inner-spin-button,
.wc-block-components-quantity-selector__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wc-block-components-quantity-selector__button {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: color 0.2s ease !important;
    outline: none !important;
}

.wc-block-components-quantity-selector__button:hover:not(:disabled) {
    color: #1e3a8a !important;
    background: transparent !important;
}

.wc-block-components-quantity-selector__button:disabled {
    color: #cbd5e1 !important;
    cursor: not-allowed !important;
}

/* Odstranění outlinů pro všechny elementy v košíku */
.wc-block-cart *:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Úprava částky celkem v košíku */
.wc-block-cart-items__header-total,
.wc-block-cart-item__total,
.wc-block-components-totals-item__value,
.wc-block-cart-item__prices {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #1e3a8a !important;
}

/* Specifická úprava pro částku celkem v řádku položky */
.wc-block-cart-item__total {
    text-align: right !important;
    padding-right: 10px !important;
}

/* Úprava ceny v pravém panelu */
.wc-block-components-totals-item__value {
    text-align: right !important;
}

/* Úprava celkové částky v pravém panelu */
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 18px !important;
    font-weight: 600 !important;
}

/* Úprava nadpisů "PRODUKT" a "CENA CELKEM" */
.wc-block-cart-items__header {
    opacity: 0.7;
}

.wc-block-cart-items__header-image,
.wc-block-cart-items__header-product,
.wc-block-cart-items__header-total {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    text-transform: none;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.wc-block-cart-items__header-total, .wc-block-cart-items__header-image {
    opacity: 0 !important;
}

/* Vylepšení pravého panelu s cenou */
.wc-block-cart__sidebar {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wc-block-cart__totals-title {
    font-weight: 600 !important;
    font-size: 18px !important;
    margin-bottom: 15px !important;
}

.wc-block-components-totals-item {
    margin-bottom: 10px !important;
}

.wc-block-components-totals-item__label {
    font-weight: 500 !important;
}

.wc-block-components-totals-footer-item {
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid #e2e8f0 !important;
}

.woocommerce.product .input-text.qty{
    height: 48px!important;
    
}


/* Responzivní úpravy pro mobilní zařízení */
@media (max-width: 768px) {
    .wc-block-cart-item__wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .wc-block-components-product-name,
    .wc-block-cart-item__prices,
    .wc-block-cart-item__quantity {
        margin-right: 0;
        margin-bottom: 10px;
        flex: 0 0 100%;
    }
}

/* Styly pro gs-tgl-show - vzhled tlačítka */
.gs-tgl-show, .gs-tgl-hide {
    display: block; /* Změněno pro umožnění centrování pomocí margin: auto */
    width: fit-content; /* Šířka se přizpůsobí obsahu */
    margin-left: auto; /* Pro horizontální centrování */
    margin-right: auto; /* Pro horizontální centrování */
    padding: 10px 20px;
    font-size: 20px; /* Větší písmo dle požadavku */
    font-weight: normal;
    color: #ffffff; /* Barva textu */
    background-color: #0073aa; /* Příklad barvy pozadí */
    border: 1px solid #0073aa;
    border-radius: 5px; /* Zakulacené rohy */
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px; /* Přidán malý horní okraj pro oddělení */
    margin-bottom: 10px; /* Přidán malý dolní okraj pro oddělení */
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.gs-tgl-show:hover, .gs-tgl-hide:hover {
    background-color: #005a87; /* Tmavší barva pozadí při najetí myší */
    border-color: #005a87;
}