/*
 * Tink's Gift Certificate Page
 * Version 0.0.2
 * Scope: /account/voucher only
 */

html.tinks-gift-v1 {
    --tgv-green: #8bd000;
    --tgv-green-dark: #77b600;
    --tgv-text: #20242a;
    --tgv-muted: #65717d;
    --tgv-border: #dfe3e7;
    --tgv-bg: #f4f5f6;
    --tgv-soft: #fafbfc;
}

/* Remove the old breadcrumb/title presentation. */
html.tinks-gift-v1 #BreadcrumbsSystem_ew4mz9c3,
html.tinks-gift-v1 #PageTitleSystem_KHyNuBbA {
    display: none !important;
}

html.tinks-gift-v1 body {
    background: var(--tgv-bg) !important;
}

html.tinks-gift-v1 #content > .main,
html.tinks-gift-v1 #content .main {
    max-width: 1240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/*
 * BurnEngine's original rows carry large negative/positive margins intended
 * for the generic account template. Flatten only this voucher page.
 */
html.tinks-gift-v1 #System_TNCrUWnx {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    color: var(--tgv-text) !important;
}

html.tinks-gift-v1 #System_TNCrUWnx > p:first-child,
html.tinks-gift-v1 #System_TNCrUWnx > .tb_sep {
    display: none !important;
}

/* Hero */
html.tinks-gift-v1 .tgv-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    max-width: 1180px;
    margin: 0 auto 14px;
    padding: 24px 28px;
    border: 1px solid var(--tgv-border);
    border-radius: 16px;
    background: #fff;
    box-sizing: border-box;
}

html.tinks-gift-v1 .tgv-kicker {
    margin-bottom: 4px;
    color: #6b7a88;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

html.tinks-gift-v1 .tgv-hero h1 {
    margin: 0 0 5px !important;
    color: var(--tgv-text) !important;
    font-family: "Titillium Web", sans-serif !important;
    font-size: 30px !important;
    line-height: 1.05 !important;
    font-weight: 700 !important;
}

html.tinks-gift-v1 .tgv-hero p {
    max-width: 720px;
    margin: 0 !important;
    color: var(--tgv-muted);
    font-size: 13px;
    line-height: 1.5;
}

html.tinks-gift-v1 .tgv-hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    border-radius: 18px;
    background: #f5fbe9;
    color: #6fac00;
    font-family: FontAwesome;
    font-size: 32px;
}

/* Timing/info strip */
html.tinks-gift-v1 .tgv-info {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 1180px;
    margin: 0 auto 14px;
    padding: 11px 14px;
    border: 1px solid #dce8c7;
    border-radius: 11px;
    background: #f8fceb;
    color: #4e5963;
    font-size: 11px;
    line-height: 1.4;
    box-sizing: border-box;
}

html.tinks-gift-v1 .tgv-info::before {
    content: "\f0e0";
    flex: 0 0 auto;
    color: #6fa800;
    font-family: FontAwesome;
    font-size: 15px;
}

/* Main form shell */
html.tinks-gift-v1 #System_TNCrUWnx form.form-horizontal {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Cards built from the native OpenCart groups. */
html.tinks-gift-v1 .tgv-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--tgv-border);
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
}

html.tinks-gift-v1 .tgv-card-recipient {
    grid-column: 1;
}

html.tinks-gift-v1 .tgv-card-sender {
    grid-column: 2;
}

html.tinks-gift-v1 .tgv-card-gift,
html.tinks-gift-v1 .tgv-actions-card {
    grid-column: 1 / -1;
}

html.tinks-gift-v1 .tgv-card-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    color: var(--tgv-text);
    font-family: "Titillium Web", sans-serif;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
}

html.tinks-gift-v1 .tgv-card-heading::before {
    color: #6fa800;
    font-family: FontAwesome;
    font-size: 14px;
    font-weight: normal;
}

html.tinks-gift-v1 .tgv-card-recipient .tgv-card-heading::before {
    content: "\f06b";
}

html.tinks-gift-v1 .tgv-card-sender .tgv-card-heading::before {
    content: "\f007";
}

html.tinks-gift-v1 .tgv-card-gift .tgv-card-heading::before {
    content: "\f02b";
}

html.tinks-gift-v1 .tgv-card-copy {
    margin: 0 0 14px;
    color: var(--tgv-muted);
    font-size: 10.5px;
    line-height: 1.4;
}

html.tinks-gift-v1 .tgv-fields {
    display: grid;
    gap: 11px;
}

html.tinks-gift-v1 .tgv-card-gift .tgv-fields {
    grid-template-columns: minmax(0, 1.7fr) minmax(230px, .8fr);
    align-items: start;
}

/* Undo Bootstrap's horizontal form layout. */
html.tinks-gift-v1 .tgv-card .form-group {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

html.tinks-gift-v1 .tgv-card .form-group > label.control-label {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 0 5px !important;
    padding: 0 !important;
    color: #4b5660 !important;
    font-size: 10.5px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    text-align: left !important;
}

html.tinks-gift-v1 .tgv-card .form-group > div[class*="col-"] {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

html.tinks-gift-v1 .tgv-card .form-control {
    display: block !important;
    width: 100% !important;
    min-height: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 8px 11px !important;
    border: 1px solid #cbd3d9 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #30363c !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

html.tinks-gift-v1 .tgv-card .form-control:focus {
    border-color: var(--tgv-green) !important;
    box-shadow: 0 0 0 2px rgba(139, 208, 0, .12) !important;
    outline: none !important;
}

html.tinks-gift-v1 #input-message {
    min-height: 132px !important;
    height: 132px !important;
    resize: vertical !important;
}

/* Amount */
html.tinks-gift-v1 .tgv-amount-wrap {
    position: relative;
}

html.tinks-gift-v1 .tgv-amount-wrap::before {
    content: "$";
    position: absolute;
    z-index: 2;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #44505b;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
}

html.tinks-gift-v1 .tgv-amount-wrap #input-amount {
    padding-left: 28px !important;
    font-weight: 700 !important;
}

html.tinks-gift-v1 .tgv-amount-help {
    margin: 6px 0 0;
    color: var(--tgv-muted);
    font-size: 9.5px;
    line-height: 1.35;
}

html.tinks-gift-v1 .tgv-amount-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}

html.tinks-gift-v1 .tgv-amount-preset {
    min-height: 34px;
    padding: 0 7px;
    border: 1px solid #d2d8dd;
    border-radius: 7px;
    background: #fff;
    color: #3d4650;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}

html.tinks-gift-v1 .tgv-amount-preset:hover,
html.tinks-gift-v1 .tgv-amount-preset.tgv-selected {
    border-color: var(--tgv-green);
    background: #f7fce9;
    color: #4d7600;
}

/* Hidden when OpenCart has only one theme; it remains checked in the DOM. */
html.tinks-gift-v1 .tgv-single-theme {
    display: none !important;
}

/* Action / disclaimer card */
html.tinks-gift-v1 .tgv-actions-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
    gap: 18px;
    align-items: center;
    padding: 15px 18px;
    border: 1px solid var(--tgv-border);
    border-radius: 14px;
    background: #fff;
}

html.tinks-gift-v1 .tgv-actions-card .pull-left,
html.tinks-gift-v1 .tgv-actions-card .pull-right {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

html.tinks-gift-v1 .tgv-actions-card label.checkbox {
    display: flex !important;
    align-items: flex-start;
    gap: 9px;
    margin: 0 !important;
    color: #4e5963 !important;
    font-size: 10.5px !important;
    line-height: 1.4 !important;
    cursor: pointer;
}

html.tinks-gift-v1 .tgv-actions-card input[type="checkbox"] {
    flex: 0 0 17px;
    width: 17px !important;
    height: 17px !important;
    margin: 1px 0 0 !important;
    accent-color: var(--tgv-green);
}

html.tinks-gift-v1 .tgv-actions-card .btn-primary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 46px !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--tgv-green) !important;
    color: #fff !important;
    font-family: "Titillium Web", sans-serif !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html.tinks-gift-v1 .tgv-actions-card .btn-primary:hover {
    background: var(--tgv-green-dark) !important;
}

/* Existing OpenCart validation errors */
html.tinks-gift-v1 .text-danger {
    display: block;
    margin-top: 5px;
    color: #c43b31 !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
}

/* Compact the native content row around the redesigned module. */
html.tinks-gift-v1 .row_3wpEe {
    margin-top: 0 !important;
}

@media (max-width: 780px) {
    html.tinks-gift-v1 .tgv-hero {
        grid-template-columns: 1fr;
        margin-left: 14px;
        margin-right: 14px;
        padding: 20px;
    }

    html.tinks-gift-v1 .tgv-hero-icon {
        display: none;
    }

    html.tinks-gift-v1 .tgv-info,
    html.tinks-gift-v1 #System_TNCrUWnx {
        width: auto !important;
        margin-left: 14px !important;
        margin-right: 14px !important;
    }

    html.tinks-gift-v1 #System_TNCrUWnx form.form-horizontal {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    html.tinks-gift-v1 .tgv-card-recipient,
    html.tinks-gift-v1 .tgv-card-sender,
    html.tinks-gift-v1 .tgv-card-gift,
    html.tinks-gift-v1 .tgv-actions-card {
        grid-column: 1 !important;
    }

    html.tinks-gift-v1 .tgv-card-gift .tgv-fields {
        grid-template-columns: 1fr !important;
    }

    html.tinks-gift-v1 .tgv-actions-card {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

@media (max-width: 420px) {
    html.tinks-gift-v1 .tgv-hero {
        margin-left: 10px;
        margin-right: 10px;
        border-radius: 14px;
        padding: 17px;
    }

    html.tinks-gift-v1 .tgv-info,
    html.tinks-gift-v1 #System_TNCrUWnx {
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    html.tinks-gift-v1 .tgv-card,
    html.tinks-gift-v1 .tgv-actions-card {
        padding: 15px !important;
    }

    html.tinks-gift-v1 .tgv-amount-presets {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================================
   v0.0.2 — Agreement checkbox alignment
   ============================================================ */

html.tinks-gift-v1
#System_TNCrUWnx
.tgv-actions-card .pull-left {
    display: flex !important;
    align-items: center !important;
}

html.tinks-gift-v1
#System_TNCrUWnx
.tgv-actions-card label.checkbox {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #4e5963 !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    text-indent: 0 !important;
    white-space: normal !important;
}

html.tinks-gift-v1
#System_TNCrUWnx
.tgv-actions-card label.checkbox input[type="checkbox"] {
    position: static !important;
    float: none !important;
    flex: 0 0 17px !important;
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    accent-color: var(--tgv-green) !important;
    transform: none !important;
}

html.tinks-gift-v1
#System_TNCrUWnx
.tgv-actions-card label.checkbox::before,
html.tinks-gift-v1
#System_TNCrUWnx
.tgv-actions-card label.checkbox::after {
    display: none !important;
    content: none !important;
}
