/*
Theme Name:   Hello Elementor Child
Template:     hello-elementor
Version:      1.1.0
Text Domain:  hello-elementor-child
*/

/* ============================================================
   Thank-You page (Termolit)
   All custom rules use the `tly-` prefix — no specificity wars
   with WooCommerce or Elementor classes.
   ============================================================ */

.tly {
    box-sizing: border-box;
    max-width: 760px;
    margin: 40px auto 60px;
    padding: 0 15px;
    font-family: inherit;
    color: #222;
    line-height: 1.5;
}

.tly *,
.tly *::before,
.tly *::after {
    box-sizing: border-box;
}

.tly-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.07);
    padding: 50px 50px 45px;
}

/* --- Success header --- */
.tly-success {
    text-align: center;
    margin-bottom: 35px;
}

.tly-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: #e23e1c;
    color: #fff;
    border-radius: 50%;
    margin-bottom: 18px;
    box-shadow: 0 6px 18px rgba(226, 62, 28, 0.3);
}

.tly-success__icon svg {
    width: 36px;
    height: 36px;
    display: block;
}

.tly-success__title {
    font-size: 26px;
    font-weight: 700;
    color: #222;
    margin: 0 0 10px;
    line-height: 1.25;
}

.tly-success__lead {
    color: #777;
    font-size: 15px;
    margin: 0;
}

/* --- Order overview (5 fields in a grid) --- */
.tly-overview {
    list-style: none;
    margin: 0 0 35px;
    padding: 22px 0;
    border-top: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.tly-overview__item {
    text-align: center;
    padding: 0 8px;
    border-right: 1px dashed #e8e8e8;
}

.tly-overview__item:last-child {
    border-right: none;
}

.tly-overview__label {
    display: block;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 6px;
    font-weight: 500;
}

.tly-overview__value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    word-break: break-word;
}

.tly-overview__value--accent {
    color: #e23e1c;
}

/* --- Section title --- */
.tly-section-title {
    font-size: 17px;
    font-weight: 600;
    color: #222;
    margin: 0 0 16px;
    text-align: left;
}

/* --- Items list --- */
.tly-items {
    margin-bottom: 30px;
}

.tly-items__list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.tly-item {
    display: grid;
    grid-template-columns: 64px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f1f1;
}

.tly-item:last-child {
    border-bottom: none;
}

.tly-item__thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 1px solid #eee;
    border-radius: 4px;
    display: block;
}

.tly-item__name {
    font-size: 14px;
    color: #222;
    line-height: 1.3;
}

.tly-item__qty {
    color: #888;
    font-size: 14px;
    min-width: 28px;
    text-align: right;
}

.tly-item__price {
    font-weight: 600;
    font-size: 14px;
    color: #222;
    text-align: right;
    min-width: 80px;
    white-space: nowrap;
}

/* --- Totals --- */
.tly-totals {
    list-style: none;
    margin: 0;
    padding: 16px 0 0;
    border-top: 1px solid #ececec;
}

.tly-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    gap: 16px;
}

.tly-totals__label {
    color: #666;
    font-size: 14px;
    font-weight: 400;
}

.tly-totals__value {
    color: #222;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

.tly-totals__row--grand {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 2px solid #ececec;
}

.tly-totals__row--grand .tly-totals__label,
.tly-totals__row--grand .tly-totals__value {
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.tly-totals__row--grand .tly-totals__value {
    color: #e23e1c;
}

/* Hide the default shipping description (long address text) - keep it short
   by wrapping. WC inserts <br>+long text inside the value. */
.tly-totals__value {
    line-height: 1.4;
}

/* --- CTA button --- */
.tly-cta {
    text-align: center;
    margin-top: 30px;
}

.tly-btn {
    display: inline-block;
    padding: 16px 44px;
    background: #e23e1c;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(226, 62, 28, 0.28);
}

.tly-btn:hover,
.tly-btn:focus {
    background: #c93414;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(226, 62, 28, 0.35);
}

.tly-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(226, 62, 28, 0.28);
}

.tly-btn--ghost {
    background: transparent;
    color: #e23e1c;
    border: 2px solid #e23e1c;
    box-shadow: none;
    margin-left: 10px;
}

.tly-btn--ghost:hover {
    background: #e23e1c;
    color: #fff;
}

/* --- Failed order --- */
.tly-card--failed .tly-failed-title {
    color: #c93414;
    font-size: 22px;
    margin: 0 0 16px;
}

/* --- Constrain Hello Elementor site-main on the thank-you page,
       since elementor-page-* body class disables the default 960px cap. --- */
body.woocommerce-order-received .site-main {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Hide WooCommerce default sub-blocks that we don't need anymore.
       Our template no longer renders the order-details/customer-details
       sections, but gateways or other plugins may still inject them via
       the woocommerce_thankyou hook. --- */
body.woocommerce-order-received .woocommerce-order-details,
body.woocommerce-order-received .woocommerce-customer-details,
body.woocommerce-order-received .woocommerce-table--custom-fields,
body.woocommerce-order-received .wc-bacs-bank-details {
    display: none !important;
}

/* --- Mobile --- */
@media (max-width: 720px) {
    .tly {
        padding: 0 10px;
        margin: 20px auto 40px;
    }
    .tly-card {
        padding: 30px 22px 28px;
    }
    .tly-success__title {
        font-size: 22px;
    }
    .tly-success__icon {
        width: 56px;
        height: 56px;
    }
    .tly-success__icon svg {
        width: 28px;
        height: 28px;
    }
    .tly-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 8px;
    }
    .tly-overview__item {
        border-right: none;
        border-bottom: 1px dashed #e8e8e8;
        padding-bottom: 14px;
    }
    .tly-overview__item:nth-last-child(-n+2) {
        border-bottom: none;
        padding-bottom: 0;
    }
    .tly-item {
        grid-template-columns: 52px 1fr auto;
        gap: 12px;
    }
    .tly-item__thumb img {
        width: 48px;
        height: 48px;
    }
    .tly-item__qty {
        display: none;
    }
    .tly-item__name {
        font-size: 13px;
    }
    .tly-btn {
        display: block;
        padding: 14px 24px;
        font-size: 14px;
    }
    .tly-btn--ghost {
        margin-left: 0;
        margin-top: 10px;
    }
}
