/* ====================================================================
   Sytech WooCommerce Gift Cards – Frontend Styles
   Designed to match the Crudo (Sytech) theme aesthetic
   ==================================================================== */

/* ---- My Account: Gift Cards page ---------------------------------- */

.stwgc-myaccount {
    max-width: 100%;
    font-family: inherit;
}

/* ---- Balance overview --------------------------------------------- */

.stwgc-balance-overview {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.stwgc-balance-card {
    background: #fff;
    border: 1px solid #dfdfdf;
    border-radius: 0;
    padding: 1.8rem 2.2rem;
    min-width: 200px;
    flex: 1;
    position: relative;
}

.stwgc-balance-card--expiring {
    border-top: 2px solid #b28150;
}

.stwgc-balance-label {
    display: block;
    font-size: 14px;
    color: #666666;
    font-weight: 400;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stwgc-balance-amount {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--title_color, #232323);
    line-height: 1.2;
}

.stwgc-balance-amount--warn {
    color: #b28150;
}

.stwgc-balance-base {
    display: block;
    font-size: 13px;
    color: #999999;
    margin-top: 0.4rem;
    font-weight: 400;
}

/* ---- Section titles ----------------------------------------------- */

.stwgc-section {
    margin-bottom: 2.5rem;
}

.stwgc-section-title {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--title_color, #232323);
    padding: 0 0 1.2rem;
    border-bottom: 1px solid #dfdfdf;
    margin: 0 0 1.5rem;
}

/* ---- Redeem form -------------------------------------------------- */

.stwgc-redeem-form {
    display: flex; 
    max-width: 100%;
    width: 580px;
    gap: 1rem;
    align-items: stretch;
}

.stwgc-redeem-form input[type="text"] {
    flex: 1;
    padding: 0 1rem;
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid #dfdfdf;
    border-right: none;
    border-radius: 0;
    color: var(--title_color, #232323);
    outline: none;
    height: 42px;
    transition: border-color 0.3s ease;
}

.stwgc-redeem-form input[type="text"]:focus {
    border-color: var(--theme_color, #333);
}

.stwgc-redeem-form input[type="text"]::placeholder {
    color: #bbb;
    letter-spacing: 3px;
    font-weight: 300;
}

.stwgc-redeem-form .button-black {
    white-space: nowrap;
    width: auto;
    padding: 0 2rem;
    line-height: 40px;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* ---- Redeem result message ---------------------------------------- */

.stwgc-redeem-result {
    margin-top: 1rem;
    padding: 0.8rem 1.2rem;
    font-size: 14px;
    border-radius: 0;
    line-height: 1.5;
}

.stwgc-redeem-result.stwgc-success {
    background: #f6f6f6;
    color: #333333;
    border: 1px solid #dfdfdf;
    border-left: 3px solid #333;
}

.stwgc-redeem-result.stwgc-error {
    background: #f6f6f6;
    color: #333333;
    border: 1px solid #dfdfdf;
    border-left: 3px solid #b28150;
}

/* ---- Transaction table -------------------------------------------- */

.stwgc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stwgc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.stwgc-table th {
    text-align: left;
    padding: 0.7rem 1.5rem 1rem;
    font-weight: 600;
    font-size: 14px;
    color: var(--title_color, #232323);
    border-bottom: 1px solid #dfdfdf;
    white-space: nowrap;
}

.stwgc-table td {
    text-align: left;
    padding: 0.8rem 1.5rem;
    font-size: 15px;
    color: #666666;
    font-weight: 400;
    border: none;
    vertical-align: middle;
}

.stwgc-table tbody tr {
    transition: background-color 0.3s ease;
}

.stwgc-table tbody tr:nth-child(odd) {
    background-color: #f6f6f6;
}

.stwgc-table tbody tr:hover {
    background-color: #e8e8e8;
}

.stwgc-table td:last-child {
    color: #333;
}

.stwgc-positive {
    color: var(--title_color, #232323) !important;
    font-weight: 600;
}

.stwgc-negative {
    color: #b28150 !important;
    font-weight: 600;
}

/* ---- Empty state -------------------------------------------------- */

.stwgc-empty {
    color: #999;
    font-size: 15px;
    padding: 2rem 0;
}

/* ---- Pagination --------------------------------------------------- */

.stwgc-pagination {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #dfdfdf;
    text-align: center;
}

.stwgc-pagination .page-numbers {
    display: inline-block;
    min-width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 14px;
    color: #666666;
    border: 1px solid #dfdfdf;
    margin: 0 3px;
    transition: all 0.3s ease;
    background: #fff;
    text-decoration: none;
}

.stwgc-pagination .page-numbers.current,
.stwgc-pagination .page-numbers:hover {
    background: var(--theme_color, #333);
    color: #fff;
    border-color: var(--theme_color, #333);
}

.stwgc-pagination .page-numbers.dots {
    border: none;
    background: none;
}

.stwgc-pagination .page-numbers.dots:hover {
    color: #666;
    background: none;
}

/* ---- Checkout: balance option ------------------------------------- */

.stwgc-checkout-balance {
    background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
    border: 1px solid #e5e5e5;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stwgc-checkout-balance.is-active {
    border-color: var(--theme_color, #333);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stwgc-balance-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
}

.stwgc-balance-icon {
    width: 44px;
    height: 44px;
    background: var(--theme_color, #333);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stwgc-balance-icon svg {
    color: #fff;
}

.stwgc-balance-info {
    flex: 1;
    min-width: 0;
}

.stwgc-balance-title {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.stwgc-balance-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--title_color, #232323);
    line-height: 1.2;
}

.stwgc-balance-value .woocommerce-Price-amount {
    color: var(--theme_color, #333);
}

/* Toggle switch */
.stwgc-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
}

.stwgc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.stwgc-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ddd;
    transition: all 0.3s ease;
    border-radius: 0;
}

.stwgc-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.stwgc-toggle input:checked + .stwgc-toggle-slider {
    background-color: var(--theme_color, #333);
}

.stwgc-toggle input:checked + .stwgc-toggle-slider:before {
    transform: translateX(24px);
}

.stwgc-balance-footer {
    background: #f8f8f8;
    padding: 0.7rem 1.5rem;
    border-top: 1px solid #eee;
}

.stwgc-balance-hint {
    font-size: 13px;
    color: #888;
}

.stwgc-checkout-balance.is-active .stwgc-balance-footer {
    background: rgba(0, 0, 0, 0.03);
}

.stwgc-checkout-balance.is-active .stwgc-balance-hint {
    color: var(--theme_color, #333);
}

/* Disabled state (gift card in cart) */
.stwgc-checkout-balance.is-disabled {
    opacity: 0.7;
}

.stwgc-checkout-balance.is-disabled .stwgc-balance-icon {
    background: #999;
}

.stwgc-balance-hint--disabled {
    color: #c0392b;
}

/* ---- Purchase fields (single product page) ------------------------ */

.stwgc-purchase-fields {
    margin: 0 0 1.2rem;
}

.stwgc-bonus-info {
    background: #f6f6f6;
    border: 1px solid #dfdfdf;
    border-left: 3px solid var(--theme_color, #333);
    border-radius: 0;
    padding: 0.8rem 1.2rem;
    font-size: 15px;
    color: #333;
    margin-bottom: 1rem;
}

.stwgc-purchase-fields .form-row {
    margin-bottom: 0.8rem;
}

.stwgc-purchase-fields label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 15px;
    color: var(--title_color, #232323);
}

.stwgc-purchase-fields input,
.stwgc-purchase-fields textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 1px solid #dfdfdf;
    border-radius: 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--title_color, #232323);
}

.stwgc-purchase-fields input::placeholder,
.stwgc-purchase-fields textarea::placeholder {
    font-size: 14px;
}

.stwgc-purchase-fields ~ .product_gary_info .add-to-cart button {
    margin-top: 0rem!important;
}


.stwgc-purchase-fields input:focus,
.stwgc-purchase-fields textarea:focus {
    outline: none;
    border-color: var(--theme_color, #333);
}

/* ---- Responsive --------------------------------------------------- */

@media screen and (max-width: 768px) {
    .stwgc-balance-overview {
        flex-direction: column;
    }

    .stwgc-balance-card {
        min-width: unset;
    }

    .stwgc-redeem-form {
        flex-direction: column;
        gap: 0.8rem;
    }

    .stwgc-redeem-form input[type="text"] {
        width: 100%!important;
        padding: 1rem!important;
        border-right: 1px solid #dfdfdf;
    }

    .stwgc-redeem-form .button-black {
        width: 100%;
    }

    .stwgc-table th:nth-child(5),
    .stwgc-table td:nth-child(5),
    .stwgc-table th:nth-child(6),
    .stwgc-table td:nth-child(6) {
        display: none;
    }

    .stwgc-table th,
    .stwgc-table td {
        padding: 0.6rem 0.8rem;
        font-size: 14px;
    }

    /* Checkout balance responsive */
    .stwgc-balance-header {
        padding: 1rem 1.2rem;
    }

    .stwgc-balance-icon {
        width: 40px;
        height: 40px;
    }

    .stwgc-balance-value {
        font-size: 1.2rem;
    }

    .stwgc-balance-footer {
        padding: 0.6rem 1.2rem;
    }
}

@media screen and (max-width: 480px) {
    .stwgc-balance-amount {
        font-size: 1.6rem;
    }

    .stwgc-table th:nth-child(4),
    .stwgc-table td:nth-child(4) {
        display: none;
    }
}

/* ---- Free gift preview (single product page) ------------------------- */

.stwgc-free-gift-preview {
    background: #f6f6f6;
    border: 1px solid #dfdfdf;
    border-radius: 0;
    margin-bottom: 1.2rem;
    overflow: hidden;
}

.stwgc-free-gift-label {
    background: var(--theme_color, #333);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 12px;
}

.stwgc-free-gift-content {
    display: flex;
    gap: 1rem;
    background-color: #ffffff;
    padding: 1rem;
    align-items: center;
}

.stwgc-free-gift-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.stwgc-free-gift-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stwgc-free-gift-info {
    flex: 1;
    min-width: 0;
}

.stwgc-free-gift-name {
    font-weight: 600; 
    font-size: 14px;
    color: var(--title_color, #232323);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.stwgc-free-gift-price {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.stwgc-free-gift-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}
.stwgc-free-gift-original-price .saved-sale{
    display: none;
}
.stwgc-free-gift-original-price del {
    text-decoration: none;
}

.stwgc-free-gift-free {
    display: inline-block;
    background: #b28150;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Cart free gift indicator ---------------------------------------- */

.stwgc-free-gift-qty {
    display: inline-block;
    padding: 4px 10px;
    background: #f6f6f6;
    color: #666;
    font-size: 14px;
}

.stwgc-cart-free-gift-badge {
    display: inline-block;
    background: #b28150;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
}
@media screen and (max-width: 768px) {
    .stwgc-purchase-fields ~ .product_gary_info .add-to-cart button {
        margin-top: 1rem !important;
    }
}
@media screen and (max-width: 480px) {
    .stwgc-free-gift-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stwgc-free-gift-image {
        width: 60px;
        height: 60px;
    }
}
