/* ==========================================
   CART PAGE STYLES
   ========================================== */

.cart-page {
    padding: 120px 0 60px;
    min-height: 80vh;
    background: #f8f9fa;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--primary-color);
}

/* Empty State */
.cart-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
}

.empty-icon i {
    font-size: 3rem;
    color: #ccc;
}

.cart-empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.cart-empty-state p {
    color: #666;
    margin-bottom: 2rem;
}

/* Cart Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* Cart Items Section */
.cart-items-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.cart-header {
    display: grid;
    grid-template-columns: 2fr 1fr 120px 1fr 60px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #666;
}

.cart-items-list {
    padding: 0 1.5rem;
}

.cart-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 120px 1fr 60px;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
}

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

.cart-item-product {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details h4 {
    font-size: 1rem;
    margin: 0 0 0.3rem;
    line-height: 1.3;
}

.cart-item-details h4 a {
    color: var(--heading-color);
    text-decoration: none;
}

.cart-item-details h4 a:hover {
    color: var(--primary-color);
}

.cart-item-variant {
    font-size: 0.85rem;
    color: #666;
}

.cart-item-sku {
    font-size: 0.8rem;
    color: #999;
}

.cart-item-price {
    font-weight: 600;
}

.cart-item-price .original {
    display: block;
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
    font-weight: normal;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-qty button {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cart-item-qty button:hover {
    background: var(--primary-color);
    color: white;
}

.cart-item-qty input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

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

.cart-item-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.cart-item-remove:hover {
    color: #e53e3e;
}

/* Cart Actions */
.cart-actions {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

/* Coupon Section */
.coupon-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.coupon-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coupon-input {
    display: flex;
    gap: 0.5rem;
}

.coupon-input input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.coupon-input input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.coupon-message {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.coupon-message.success {
    color: #38a169;
}

.coupon-message.error {
    color: #e53e3e;
}

/* Summary Rows */
.summary-rows {
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row.coupon-discount {
    color: #38a169;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: none;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid #eee;
}

.summary-tax {
    text-align: right;
    color: #666;
    margin-bottom: 1.5rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.trust-badge i {
    width: 24px;
    color: var(--primary-color);
}

/* Payment Methods */
.payment-methods {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
}

.payment-methods span {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.payment-icons i {
    font-size: 2rem;
    color: #999;
    transition: color 0.3s ease;
}

.payment-icons i:hover {
    color: var(--primary-color);
}

/* ==========================================
   CHECKOUT PAGE STYLES
   ========================================== */

.checkout-page {
    padding: 120px 0 60px;
    min-height: 80vh;
    background: #f8f9fa;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

/* Checkout Steps */
.checkout-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.checkout-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #999;
    font-weight: 500;
}

.checkout-step.active {
    color: var(--primary-color);
}

.checkout-step.completed {
    color: #38a169;
}

.checkout-step .step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border-radius: 50%;
    font-weight: 600;
}

.checkout-step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.checkout-step.completed .step-number {
    background: #38a169;
    color: white;
}

/* Checkout Form */
.checkout-form-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
}

.form-section-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group label .required {
    color: #e53e3e;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-group.error input,
.form-group.error select {
    border-color: #e53e3e;
}

.form-error {
    color: #e53e3e;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 0.2rem;
}

/* Payment Methods */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-option:hover {
    border-color: #ddd;
}

.payment-option.selected {
    border-color: var(--primary-color);
    background: rgba(217, 119, 6, 0.05);
}

.payment-option input {
    display: none;
}

.payment-radio {
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-option.selected .payment-radio {
    border-color: var(--primary-color);
}

.payment-option.selected .payment-radio::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
}

.payment-icon {
    font-size: 1.5rem;
    color: #666;
    width: 40px;
    text-align: center;
}

.payment-info h4 {
    margin: 0 0 0.2rem;
    font-size: 1rem;
}

.payment-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* Order Summary (Checkout) */
.order-summary {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.order-summary h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.order-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.order-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.order-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-qty {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-item-info {
    flex: 1;
}

.order-item-info h4 {
    margin: 0 0 0.2rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.order-item-info .variant {
    font-size: 0.8rem;
    color: #666;
}

.order-item-price {
    font-weight: 600;
    white-space: nowrap;
}

/* Shipping Methods */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shipping-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shipping-option:hover {
    border-color: #ddd;
}

.shipping-option.selected {
    border-color: var(--primary-color);
    background: rgba(217, 119, 6, 0.05);
}

.shipping-option input {
    display: none;
}

.shipping-option-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shipping-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shipping-option.selected .shipping-radio {
    border-color: var(--primary-color);
}

.shipping-option.selected .shipping-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

.shipping-info h4 {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
}

.shipping-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

.shipping-price {
    font-weight: 600;
}

.shipping-price.free {
    color: #38a169;
}

/* Checkout Footer */
.checkout-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 992px) {
    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary,
    .order-summary {
        position: static;
    }

    .cart-header {
        display: none;
    }

    .cart-item-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        position: relative;
    }

    .cart-item-product {
        padding-right: 40px;
    }

    .cart-item-remove {
        position: absolute;
        top: 1.5rem;
        right: 0;
    }

    .cart-item-price,
    .cart-item-total {
        display: flex;
        justify-content: space-between;
    }

    .cart-item-price::before {
        content: 'Prezzo: ';
        font-weight: normal;
        color: #666;
    }

    .cart-item-total::before {
        content: 'Totale: ';
        font-weight: normal;
        color: #666;
    }

    .cart-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .cart-actions .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .checkout-steps {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkout-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .checkout-footer .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .cart-page,
    .checkout-page {
        padding-top: 100px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-details h4 {
        font-size: 0.9rem;
    }
}

/* ==========================================
   UTILITY CLASSES FOR CHECKOUT
   ========================================== */

/* Hidden by default (for JS toggle) */
.hidden-js {
    display: none;
}

/* Stripe card section */
#stripeCardSection {
    margin-top: 1.5rem;
}

/* Stripe card element styling */
#card-element {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Loading overlay */
.loading-overlay {
    display: none;
}
