/* D2 Cart — Editora dos Pioneiros */

/* ── Accessibility: screen-reader-only text ── */
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.screen-reader-text:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 12px 24px !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    background: #d4a84b !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    z-index: 100000 !important;
    display: block !important;
}

/* ── Header & Footer (shared with checkout) ── */
.d2-header {
    background: #3a3a3a;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #d4a84b;
}
.d2-header-logo { color: #d4a84b; font-size: 20px; font-weight: 700; text-decoration: none; }
.d2-header-center { color: #ccc; font-size: 16px; font-weight: 300; }
.d2-header-right a { color: #d4a84b; font-size: 13px; text-decoration: none; }

.d2-footer {
    background: #3a3a3a;
    padding: 16px 40px;
    text-align: center;
    color: #888;
    font-size: 12px;
    margin-top: 40px;
}
.d2-footer a { color: #d4a84b; text-decoration: none; }

/* ── Two-column layout ── */
.d2-cart-layout {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

/* ── Left column: Cart items card ── */
.d2-cart-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.d2-cart-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 2px solid #f0ebe0;
}

.d2-cart-card-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.d2-cart-count {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

/* ── Cart items ── */
.d2-cart-items {
    padding: 0;
}

.d2-cart-item {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
}

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

/* Thumbnail */
.d2-cart-item-thumb {
    width: 80px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f5ee;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.d2-cart-item-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.d2-cart-item-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Details */
.d2-cart-item-details {
    flex: 1;
    min-width: 0;
}

.d2-cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

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

.d2-cart-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.4;
}

.d2-cart-item-name a {
    color: #1a1a1a;
    text-decoration: none;
}

.d2-cart-item-name a:hover {
    color: #d4a84b;
}

.d2-cart-item-price {
    font-size: 13px;
    color: #888;
}

.d2-cart-item-subtotal {
    font-size: 17px;
    font-weight: 700;
    color: #b8860b;
    white-space: nowrap;
}

/* Bottom row: qty + remove */
.d2-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Quantity input */
.d2-cart-item-qty .quantity {
    display: flex;
    align-items: center;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.d2-cart-item-qty .quantity input[type="number"] {
    width: 44px !important;
    height: 36px !important;
    text-align: center !important;
    border: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    background: #fff !important;
    -moz-appearance: textfield !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.d2-cart-item-qty .quantity input::-webkit-outer-spin-button,
.d2-cart-item-qty .quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Quantity +/- buttons (if WC adds them) */
.d2-cart-item-qty .quantity .qty-btn,
.d2-cart-item-qty .quantity button {
    width: 36px;
    height: 36px;
    background: #f8f8f8;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d2-cart-item-qty .quantity .qty-btn:hover,
.d2-cart-item-qty .quantity button:hover {
    background: #eee;
}

/* Remove link */
.d2-remove-link {
    font-size: 13px !important;
    color: #c0392b !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}

.d2-remove-link:hover {
    text-decoration: underline !important;
    color: #a93226 !important;
}

/* ── Cart actions row ── */
.d2-cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid #f0ebe0;
    background: #fafafa;
}

.d2-cart-coupon {
    display: flex;
    gap: 6px;
    flex: 1;
    max-width: 340px;
}

.d2-coupon-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    background: #fff;
    color: #333;
}

.d2-coupon-input:focus {
    outline: none;
    border-color: #d4a84b;
    box-shadow: 0 0 0 3px rgba(212,168,75,0.12);
}

.d2-coupon-btn {
    padding: 10px 16px;
    background: #f0f0f0;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    font-family: inherit;
    white-space: nowrap;
}

.d2-coupon-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.d2-update-btn {
    padding: 10px 20px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    font-family: inherit;
    white-space: nowrap;
    margin-left: auto;
}

.d2-update-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* ── Right column: Summary ── */
.d2-cart-summary-col {
    position: sticky;
    top: 20px;
    align-self: start;
}

.d2-cart-summary {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
}

.d2-cart-summary-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0ebe0;
}

/* Summary lines */
.d2-cart-summary-lines {
    margin-bottom: 16px;
}

.d2-cart-summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #555;
}

.d2-cart-summary-line--coupon {
    color: #2e7d32;
}

/* Shipping section */
.d2-cart-summary-shipping {
    padding: 8px 0;
    font-size: 14px;
    color: #555;
}

.d2-cart-summary-shipping table {
    width: 100% !important;
    border: none !important;
    border-collapse: collapse !important;
}

.d2-cart-summary-shipping tr {
    display: flex !important;
    flex-direction: column !important;
}

.d2-cart-summary-shipping th {
    border: none !important;
    background: transparent !important;
    padding: 8px 0 4px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    text-align: left !important;
    display: block !important;
}

.d2-cart-summary-shipping td {
    border: none !important;
    background: transparent !important;
    padding: 0 0 8px !important;
    font-size: 13px !important;
    color: #666 !important;
    display: block !important;
}

.d2-cart-summary-shipping .woocommerce-shipping-methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 4px 0 0 !important;
}

.d2-cart-summary-shipping .woocommerce-shipping-methods li {
    padding: 6px 0 !important;
    font-size: 13px !important;
}

.d2-cart-summary-shipping .woocommerce-shipping-methods li label {
    cursor: pointer !important;
    font-size: 13px !important;
}

.d2-cart-summary-shipping .woocommerce-shipping-methods li input[type="radio"] {
    accent-color: #d4a84b !important;
    margin-right: 6px !important;
}

.d2-cart-summary-shipping .shipping-calculator-button {
    font-size: 12px !important;
    color: #d4a84b !important;
    text-decoration: none !important;
}

/* Total */
.d2-cart-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0 0;
    margin-top: 4px;
    border-top: 2px solid #f0ebe0;
    font-size: 18px;
    font-weight: 700;
}

.d2-cart-summary-total span:first-child {
    color: #1a1a1a;
}

.d2-cart-summary-total span:last-child {
    color: #b8860b;
}

/* Checkout button */
.d2-cart-checkout-wrap {
    margin-top: 20px;
    text-align: center;
}

.d2-cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #d4a84b !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(212,168,75,0.25);
    font-family: inherit;
    transition: background 0.15s;
}

.d2-cart-checkout-btn:hover,
.d2-cart-checkout-btn:visited,
.d2-cart-checkout-btn:focus {
    background: #c49a3f !important;
    color: #fff !important;
    text-decoration: none !important;
}

.d2-cart-continue-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    color: #d4a84b !important;
    text-decoration: none !important;
    font-weight: 500;
}

.d2-cart-continue-link:hover {
    text-decoration: underline !important;
}

/* ── Empty cart ── */
.d2-cart-empty {
    max-width: 540px;
    margin: 80px auto;
    text-align: center;
    padding: 40px 20px;
}

.d2-cart-empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.d2-cart-empty h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.d2-cart-empty p {
    font-size: 15px;
    color: #888;
    margin-bottom: 24px;
}

.d2-cart-empty-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #d4a84b !important;
    color: #fff !important;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
}

.d2-cart-empty-btn:hover {
    background: #c49a3f !important;
    color: #fff !important;
}

/* ── Hide default WC cart elements ── */
.d2-cart .cart_totals,
.d2-cart .woocommerce-cart-form__contents,
.d2-cart .shop_table,
.woocommerce-cart .cart-collaterals {
    display: none !important;
}

/* ── WooCommerce notices ── */
.woocommerce-cart .woocommerce-error,
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info {
    max-width: 1080px !important;
    margin: 16px auto !important;
    padding: 14px 20px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
}

.woocommerce-cart .woocommerce-message {
    background: #f0faf0 !important;
    border: 1px solid #c8e6c9 !important;
    color: #2e7d32 !important;
}

.woocommerce-cart .woocommerce-error {
    background: #fef1f1 !important;
    border: 1px solid #e8a0a0 !important;
    color: #c0392b !important;
    list-style: none !important;
}

.woocommerce-cart .woocommerce-info {
    background: #f0f4fa !important;
    border: 1px solid #b8cce8 !important;
    color: #2c5282 !important;
}

/* ── Pioneer encouragement nudge (below cart, side-by-side) ── */
.d2-cart-pioneer-nudge {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.d2-cart-pioneer-img {
    width: 200px;
    flex-shrink: 0;
    height: auto;
    display: block;
    opacity: 0.85;
}

.d2-cart-pioneer-text {
    font-size: 18px;
    color: #555;
    line-height: 1.7;
}

.d2-cart-pioneer-text p {
    margin: 0;
}

.d2-cart-pioneer-text strong {
    color: #d4a84b;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .d2-cart-layout {
        grid-template-columns: 1fr;
    }

    .d2-cart-summary-col {
        position: static;
        order: -1;
    }

    .d2-cart-item {
        padding: 16px;
    }

    .d2-cart-item-thumb {
        width: 64px;
        height: 80px;
    }

    .d2-cart-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .d2-cart-coupon {
        max-width: 100%;
    }

    .d2-update-btn {
        margin-left: 0;
        width: 100%;
    }

    .d2-header {
        padding: 12px 16px;
    }

    .d2-header-center {
        display: none;
    }

    .d2-cart-card-header {
        padding: 16px;
    }

    .d2-cart-item-top {
        flex-direction: column;
        gap: 6px;
    }

    .d2-cart-item-subtotal {
        font-size: 15px;
    }
}
