.tpc-overlay,
.tpc-overlay * {
    font-family: "Hind Siliguri", sans-serif;
}

.tpc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tpc-modal {
    width: 100%;
    max-width: 560px;
    background: #f9fafb;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: tpcFadeInUp 0.25s ease;
}

@keyframes tpcFadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close button */
.tpc-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #536279;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.2s ease;
    box-shadow: none;
}

.tpc-close i {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    line-height: 1;
}

.tpc-close:hover {
    background: transparent;
    color: #111827;
}

.tpc-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.tpc-header {
    padding: 22px 60px 12px 24px;
    text-align: center;
}

.tpc-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.tpc-body {
    padding: 0 20px 22px;
}

.tpc-form-wrap {
    margin-bottom: 18px;
}

.tpc-field {
    margin-bottom: 14px;
}

.tpc-field-icon {
    display: flex;
    align-items: stretch;
    border: 1px solid #d7dce3;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.tpc-field-icon .tpc-icon {
    width: 46px;
    min-width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-right: 1px solid #d7dce3;
    font-size: 18px;
}

.tpc-field-icon .tpc-icon i {
    width: 1em;
    color: #374151;
    font-family: "Font Awesome 6 Free";
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.tpc-field input,
.tpc-field textarea {
    width: 100%;
    border: none;
    outline: none;
    box-shadow: none;
    padding: 14px;
    font-size: 16px;
    background: transparent;
    margin: 0;
    color: #111827;
}

.tpc-field input::placeholder,
.tpc-field textarea::placeholder {
    color: #9ca3af;
}

.tpc-field textarea {
    min-height: 78px;
    resize: vertical;
}

.tpc-cart-content {
    margin-top: 12px;
}

.tpc-loading {
    padding: 16px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpc-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e5e7eb;
    border-top-color: #111827;
    border-radius: 50%;
    display: inline-block;
    animation: tpcSpin 0.75s linear infinite;
}

@keyframes tpcSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.tpc-cart-items {
    display: grid;
    gap: 10px;
    border-top: none;
}

.tpc-cart-item {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto 32px;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

.tpc-cart-item,
.tpc-cart-item * {
    box-sizing: border-box;
}

.tpc-cart-thumb {
    position: relative;
    align-self: start;
}

.tpc-cart-thumb img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    border: 1px solid #eef1f5;
}

.tpc-qty-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}

.tpc-cart-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.32;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tpc-cart-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 1px;
}

.tpc-quantity-control {
    width: max-content;
    display: inline-grid;
    grid-template-columns: 34px 46px 34px;
    gap: 0;
    align-items: center;
    padding: 0;
    border: 1px solid #d8dee7;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
}

.tpc-qty-btn,
.tpc-qty-display {
    height: 30px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    color: #111827;
    background: #ffffff;
    font-size: 13px;
    line-height: 30px;
}

.tpc-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tpc-qty-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: #111827;
}

.tpc-qty-btn:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(17, 24, 39, 0.14);
}

.tpc-qty-display {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-width: 46px;
    border-left: 1px solid #d8dee7;
    border-right: 1px solid #d8dee7;
    color: #020617 !important;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    opacity: 1;
    user-select: none;
}

.tpc-qty-btn:disabled,
.tpc-remove-item:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.tpc-cart-content.tpc-cart-updating {
    opacity: 0.68;
    pointer-events: none;
}

.tpc-cart-price {
    justify-self: end;
    padding-top: 3px;
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Remove button */
.tpc-remove-item {
    width: 30px;
    height: 30px;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #f8fafc;
    color: #6b7280;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    align-self: start;
    justify-self: end;
    transition: all 0.2s ease;
    box-shadow: none;
}

.tpc-remove-item:hover {
    background: #fee2e2;
    color: #dc2626;
}

.tpc-remove-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.tpc-summary-box {
    border: 1px solid #d1d7df;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 16px;
    padding: 6px 8px 7px;
    background: #f9fafb;
    box-shadow: none;
}

.tpc-summary-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 3px 0;
    border-bottom: none;
    font-size: 15px;
    color: #111827;
    line-height: 1.35;
}

.tpc-summary-row span {
    font-weight: 400;
}

.tpc-summary-row strong {
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tpc-summary-row.total-row {
    border-top: 1px solid #d7dce3;
    margin-top: 7px;
    background: transparent;
    font-size: 16px;
    font-weight: 800;
    padding-top: 9px;
    padding-bottom: 0;
}

.tpc-summary-row.total-row span,
.tpc-summary-row.total-row strong {
    color: #111827;
    font-weight: 800;
}

.tpc-summary-row.total-row strong {
    font-size: 20px;
}

.tpc-shipping-box {
    margin-top: 16px;
}

.tpc-shipping-box h4 {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 8px;
    color: #111827;
    line-height: 1.25;
}

.tpc-radio-row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    gap: 20px;
    align-items: center;
    border: 1px solid #d7dce3;
    border-bottom: none;
    padding: 6px 14px 6px 14px;
    margin-bottom: 0;
    border-radius: 0;
    cursor: pointer;
    background: #f9fafb;
    transition: background-color 0.2s ease;
}

.tpc-radio-row:first-of-type {
    border-radius: 4px 4px 0 0;
}

.tpc-radio-row:last-of-type {
    border-bottom: 1px solid #d7dce3;
    border-radius: 0 0 4px 4px;
}

.tpc-radio-row:hover {
    background: #ffffff;
}

.tpc-radio-row input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid #111827;
    border-radius: 50%;
    background: #ffffff;
    margin: 0;
    cursor: pointer;
    display: grid;
    place-content: center;
}

.tpc-radio-row input[type="radio"]::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #111827;
    transform: scale(0);
    transition: transform 0.12s ease;
}

.tpc-radio-row input[type="radio"]:checked::before {
    transform: scale(1);
}

.tpc-radio-row input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.tpc-radio-label {
    font-size: 16px;
    color: #111827;
    line-height: 1.25;
}

.tpc-radio-price {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tpc-complete-order {
    width: 100%;
    margin-top: 18px;
    border: none;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    border-radius: 6px;
    padding: 16px 20px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: none;
}

.tpc-complete-order:hover {
    opacity: 0.96;
}

.tpc-complete-order:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.14);
}

.tpc-complete-order:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.tpc-error-message {
    margin-top: 12px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.tpc-empty-cart {
    text-align: center;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 16px;
    color: #374151;
    background: #ffffff;
}

body.tpc-no-scroll {
    overflow: hidden;
}


.tpc-complete-order {
    animation: tpcButtonPulse 2.0s infinite;
}

.tpc-complete-order:hover,
.tpc-complete-order:focus,
.tpc-complete-order:active {
    animation-play-state: paused;
}

@keyframes tpcButtonPulse {
    0% {
        transform: scale(1);
    }
    8% {
        transform: scale(1.03);
    }
    16% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 767px) {
    .tpc-overlay {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .tpc-modal {
        margin-top: 10px;
        max-width: 100%;
        border-radius: 8px;
    }

    .tpc-close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
        font-size: 24px;
    }

    .tpc-header {
        padding: 18px 48px 12px 18px;
    }

    .tpc-header h2 {
        font-size: 20px;
    }

    .tpc-body {
        padding: 0 16px 18px;
    }

    .tpc-cart-items {
        gap: 8px;
    }

    .tpc-cart-item {
        grid-template-columns: 58px minmax(0, 1fr) 30px;
        gap: 8px 12px;
        padding: 10px;
    }

    .tpc-cart-thumb img {
        width: 58px;
        height: 58px;
    }

    .tpc-cart-details {
        gap: 8px;
    }

    .tpc-cart-name {
        font-size: 14px;
        line-height: 1.32;
    }

    .tpc-quantity-control {
        grid-template-columns: 34px 46px 34px;
    }

    .tpc-qty-btn,
    .tpc-qty-display {
        height: 30px;
    }

    .tpc-qty-display {
        width: 46px;
        min-width: 46px;
    }

    .tpc-remove-item {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 20px;
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: start;
    }

    .tpc-cart-price {
        grid-column: 2;
        justify-self: start;
        padding-top: 0;
        font-size: 14px;
        text-align: left;
    }

    .tpc-summary-row {
        font-size: 15px;
    }

    .tpc-summary-row.total-row {
        font-size: 17px;
    }

    .tpc-radio-row {
        grid-template-columns: 22px 1fr auto;
        gap: 12px;
        padding: 7px 10px 7px 14px;
    }

    .tpc-radio-label,
    .tpc-radio-price {
        font-size: 15px;
    }

    .tpc-complete-order {
        font-size: 17px;
        padding: 14px 16px;
    }
}
