/*
 * Lite Cart & Checkout for WooCommerce — Frontend Styles
 * Version: 1.0.0  |  Lightweight & fully responsive
 */

/* ─── Base ──────────────────────────────────────────────────── */
.lcc-cart-wrap *,
.lcc-checkout-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.lcc-cart-wrap,
.lcc-checkout-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
}

/* ─── Cart Wrapper ──────────────────────────────────────────── */
.lcc-cart-inner {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

/* ─── Cart Item ─────────────────────────────────────────────── */
.lcc-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f2f2f2;
}
.lcc-cart-item:first-child { padding-top: 0; }

.lcc-item-thumb {
    flex-shrink: 0;
}
.lcc-item-thumb img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background: #f5f5f5;
}

.lcc-item-info {
    flex: 1;
    min-width: 0;
}

.lcc-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Prices */
.lcc-item-pricing {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.lcc-price-original {
    font-size: 12px;
    color: #aaa;
    text-decoration: line-through;
}

.lcc-price-sale {
    font-size: 14px;
    font-weight: 700;
    color: #ff6600;
}

/* Qty control */
.lcc-qty-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
}

.lcc-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #555;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.lcc-qty-btn:hover { background: #efefef; }
.lcc-qty-btn:active { background: #e0e0e0; }

.lcc-qty-num {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    line-height: 30px;
}

/* Right side of cart item */
.lcc-item-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.lcc-item-line-total {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

.lcc-remove-item {
    background: none;
    border: none;
    color: #c0c0c0;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.lcc-remove-item:hover {
    color: #e33;
    background: #fff0f0;
}

/* ─── Empty State ───────────────────────────────────────────── */
.lcc-empty-state {
    text-align: center;
    padding: 36px 20px;
    color: #aaa;
}
.lcc-empty-icon {
    display: block;
    font-size: 40px;
    margin-bottom: 10px;
}
.lcc-empty-state p {
    font-size: 15px;
}

/* ─── Coupon Box ────────────────────────────────────────────── */
.lcc-coupon-box {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}
.lcc-coupon-box .lcc-input {
    flex: 1;
}

/* ─── Inputs ────────────────────────────────────────────────── */
.lcc-input {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    color: #111;
    background: #fff;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    -webkit-appearance: none;
}
.lcc-input:focus {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255,102,0,.10);
}
.lcc-input::placeholder { color: #bbb; }

.lcc-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.lcc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s, color .18s, box-shadow .18s;
    white-space: nowrap;
    line-height: 1.4;
}

.lcc-btn-primary {
    background: #ff6600;
    color: #fff;
}
.lcc-btn-primary:hover, .lcc-btn-primary:focus {
    background: #e55a00;
    box-shadow: 0 2px 8px rgba(255,102,0,.25);
    color: #fff;
}
.lcc-btn-primary:active { background: #cc5200; }
.lcc-btn-primary:disabled {
    background: #ffb380;
    cursor: not-allowed;
}

.lcc-btn-outline {
    background: #fff;
    color: #ff6600;
    border: 1.5px solid #ff6600;
}
.lcc-btn-outline:hover, .lcc-btn-outline:focus {
    background: #fff5ee;
    color: #ff6600;
}

.lcc-btn-full {
    display: flex;
    width: 100%;
    margin-top: 18px;
    padding: 13px 20px;
    font-size: 15px;
}

/* ─── Totals ────────────────────────────────────────────────── */
.lcc-cart-totals,
.lcc-totals {
    margin-top: 18px;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}

.lcc-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 14px;
    color: #333;
    gap: 12px;
}
.lcc-totals-row em { font-style: normal; }

.lcc-row-discount {
    color: #ff6600;
    font-weight: 500;
}

.lcc-row-coupon {
    color: #888;
    font-size: 13px;
}

.lcc-row-total {
    border-top: 1px solid #e8e8e8;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

/* Remove coupon inside totals */
.lcc-remove-coupon {
    background: none;
    border: none;
    color: #c0c0c0;
    cursor: pointer;
    font-size: 11px;
    padding: 1px 3px;
    border-radius: 3px;
    margin-left: 4px;
    transition: color .15s;
}
.lcc-remove-coupon:hover { color: #e33; }

/* ─── Messages ──────────────────────────────────────────────── */
.lcc-msg {
    font-size: 13px;
    min-height: 20px;
    margin-top: 6px;
    font-weight: 500;
}
.lcc-msg.lcc-success { color: #ff6600; }
.lcc-msg.lcc-error   { color: #d32f2f; }

/* ─── Spinner ───────────────────────────────────────────────── */
.lcc-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lcc-spin .65s linear infinite;
    flex-shrink: 0;
}

@keyframes lcc-spin {
    to { transform: rotate(360deg); }
}

/* ─── Checkout Layout ───────────────────────────────────────── */
.lcc-checkout-wrap {
    width: 100%;
}

.lcc-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 28px;
    align-items: start;
}

.lcc-billing-section,
.lcc-order-summary {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.lcc-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f0;
}

/* ─── Form ──────────────────────────────────────────────────── */
.lcc-form-group {
    margin-bottom: 16px;
}

.lcc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.lcc-req { color: #e33; margin-left: 2px; }

.lcc-form-row {
    display: flex;
    gap: 14px;
}
.lcc-two-col > .lcc-form-group {
    flex: 1;
    min-width: 0;
}

/* ─── Order Items (Editable) ────────────────────────────────── */
.lcc-oi-list { margin-bottom: 4px; }

.lcc-oi-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 14px;
    transition: opacity .2s;
}

/* Left: thumb + meta */
.lcc-oi-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.lcc-oi-thumb {
    flex-shrink: 0;
}
.lcc-oi-thumb img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: #f5f5f5;
}

.lcc-oi-meta {
    flex: 1;
    min-width: 0;
}

.lcc-oi-name {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 3px;
    line-height: 1.35;
}

.lcc-oi-unit-price {
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* Qty controls inside order summary */
.lcc-oi-qty-ctrl {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    background: #fafafa;
}
.lcc-oi-qty-ctrl .lcc-qty-btn {
    width: 26px;
    height: 26px;
    font-size: 15px;
}
.lcc-oi-qty-ctrl .lcc-qty-num {
    min-width: 24px;
    font-size: 13px;
    line-height: 26px;
}

/* Right: total + remove */
.lcc-oi-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.lcc-oi-line-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.lcc-oi-reg-total {
    font-size: 11px;
}

.lcc-oi-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s, background .15s;
}
.lcc-oi-remove:hover {
    color: #e33;
    background: #fff0f0;
}

/* ─── Responsive: Tablet ────────────────────────────────────── */
@media (max-width: 860px) {
    .lcc-checkout-grid {
        grid-template-columns: 1fr;
    }

    .lcc-order-summary {
        order: -1; /* Summary on top on small screens */
    }
}

/* ─── Responsive: Mobile ────────────────────────────────────── */
@media (max-width: 540px) {
    .lcc-cart-inner,
    .lcc-billing-section,
    .lcc-order-summary {
        padding: 18px 16px;
        border-radius: 10px;
    }

    .lcc-form-row {
        flex-direction: column;
        gap: 0;
    }

    .lcc-item-thumb img {
        width: 54px;
        height: 54px;
    }

    .lcc-btn-full {
        font-size: 14px;
    }

    .lcc-checkout-grid {
        gap: 18px;
    }
}

@media (max-width: 380px) {
    .lcc-cart-inner,
    .lcc-billing-section,
    .lcc-order-summary {
        padding: 14px 12px;
    }

    .lcc-coupon-box {
        flex-direction: column;
    }

    .lcc-coupon-box .lcc-btn {
        width: 100%;
    }

    .lcc-oi-thumb img {
        width: 42px;
        height: 42px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Payment Methods  — v1.1.0
═══════════════════════════════════════════════════════════════ */

.lcc-payment-section {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 2px solid #f0f0f0;
}

.lcc-payment-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    margin-bottom: 14px;
}

.lcc-payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lcc-payment-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 9px;
    cursor: pointer;
    transition: border-color .18s, background .18s, box-shadow .18s;
    background: #fff;
    user-select: none;
}

.lcc-payment-option:hover {
    border-color: #ff6600;
    background: #fff8f3;
}

.lcc-payment-option.lcc-payment-selected {
    border-color: #ff6600;
    background: #fff5ee;
    box-shadow: 0 0 0 3px rgba(255,102,0,.10);
}

.lcc-payment-radio-wrap {
    padding-top: 2px;
    flex-shrink: 0;
}

.lcc-payment-radio {
    width: 18px;
    height: 18px;
    accent-color: #ff6600;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.lcc-payment-info {
    flex: 1;
    min-width: 0;
}

.lcc-payment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    flex-wrap: wrap;
}

.lcc-payment-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.lcc-payment-icon img {
    max-height: 22px;
    width: auto;
    border-radius: 3px;
    vertical-align: middle;
}

.lcc-payment-desc {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.55;
}
.lcc-payment-desc p {
    margin: 0;
}
.lcc-payment-desc a {
    color: #ff6600;
    text-decoration: underline;
}

.lcc-no-gateway-notice {
    margin-top: 20px;
    padding: 14px 16px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    font-size: 14px;
    color: #7a5200;
}

/* ═══════════════════════════════════════════════════════════════
   Terms & Conditions  — v1.1.0
═══════════════════════════════════════════════════════════════ */

.lcc-terms-row {
    margin-top: 22px;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}

.lcc-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.lcc-terms-check {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: #ff6600;
    cursor: pointer;
    flex-shrink: 0;
}

.lcc-terms-text {
    flex: 1;
}

.lcc-tc-link {
    color: #ff6600;
    font-weight: 600;
    text-decoration: underline;
}
.lcc-tc-link:hover {
    color: #e55a00;
}

/* ═══════════════════════════════════════════════════════════════
   Order Success / Thank-You compatibility  — v1.1.0
═══════════════════════════════════════════════════════════════ */

/* Pulse animation for success message */
@keyframes lcc-pulse-green {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.03); }
    100% { transform: scale(1); }
}

#lcc-order-msg.lcc-success {
    font-size: 14px;
    padding: 10px 14px;
    background: #fff5ee;
    border: 1px solid #ffcc99;
    border-radius: 7px;
    animation: lcc-pulse-green .5s ease;
}

#lcc-order-msg.lcc-error {
    font-size: 14px;
    padding: 10px 14px;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 7px;
}

/* ─── Mobile adjustments for new sections ────────────────────── */
@media (max-width: 540px) {
    .lcc-payment-option {
        padding: 12px 13px;
    }
    .lcc-terms-row {
        padding: 12px 13px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v1.2.0 — Edit Cart button, qty label, summary header
═══════════════════════════════════════════════════════════════ */

/* Summary header: title + edit cart button side by side */
.lcc-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    gap: 10px;
}
.lcc-summary-header .lcc-section-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    flex: 1;
}

/* Edit Cart button */
.lcc-btn-edit-cart {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    background: #fff;
    color: #ff6600;
    border: 1.5px solid #ff6600;
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}
.lcc-btn-edit-cart:hover,
.lcc-btn-edit-cart:focus {
    background: #fff5ee;
    color: #e55a00;
    text-decoration: none;
}

/* Divider line under summary header */
.lcc-summary-header + #lcc-order-items {
    border-top: 2px solid #f0f0f0;
    padding-top: 4px;
    margin-top: 16px;
}

/* Qty label (replaces +/- controls) */
.lcc-item-qty-label,
.lcc-oi-qty-label {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}
.lcc-item-qty-label strong,
.lcc-oi-qty-label strong {
    color: #111;
}
