/**
 * WooCommerce Cart - Simple Clean Design
 */

.hep-woocommerce-cart {
    direction: rtl !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 30px 20px !important;
}

/* Progress Steps - Full Width */
.hep-progress-steps {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 20px !important;
    margin: 0 0 40px 0 !important;
    padding: 30px 40px !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e5e7eb !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.hep-progress-step {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative !important;
    flex: 1 !important;
    opacity: 0.4 !important;
    transition: opacity 0.3s ease !important;
}

.hep-progress-step.active {
    opacity: 1 !important;
}

.hep-progress-circle {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
    border: 2px solid #e2e8f0 !important;
    transition: all 0.3s ease !important;
}

.hep-progress-step.active .hep-progress-circle {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.hep-progress-content {
    text-align: center !important;
}

.hep-progress-content h4 {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    transition: color 0.3s ease !important;
}

.hep-progress-step.active .hep-progress-content h4 {
    color: #1e293b !important;
}

.hep-progress-content p {
    margin: 4px 0 0 0 !important;
    font-size: 12px !important;
    color: #cbd5e1 !important;
    display: none !important;
}

/* Cart Table Card - White with border */
.hep-cart-card {
    padding:30px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid #e5e7eb !important;
    margin-bottom: 20px !important;
    overflow: hidden !important;
}

/* Cart Table */
.hep-cart-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.hep-cart-table thead {
    background: transparent !important;
}

.hep-cart-table th {
    padding: 18px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    text-align: center !important;
    border-bottom: none !important;
    border: none !important;
}

.hep-cart-table th:last-child {
    text-align: right !important;
}

.hep-cart-table tbody tr {
    border-bottom: none !important;
}

.hep-cart-table td {
    padding: 20px 24px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.hep-cart-table td:last-child {
    padding-left:10px !important;
    text-align: left !important;
}

/* Product */
.hep-product-cell {
    width: 45% !important;
    border: none !important;
}

.hep-product-info {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    flex-direction: row-reverse !important;
}

.hep-product-info img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
}

.hep-product-details {
    flex: 1 !important;
    text-align: right !important;
}

.hep-product-details h4 {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #2563eb !important;
    line-height: 1.5 !important;
}

.hep-product-details h4 a {
    color: #2563eb !important;
    text-decoration: none !important;
}

/* Price and Subtotal */
.hep-price-cell,
.hep-subtotal-cell {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    border: none !important;
}

/* Quantity */
.hep-quantity-cell {
    width: 12% !important;
    border: none !important;
}


.hep-quantity-input,
.hep-quantity-cell .quantity input[type="number"] {
    width: 50px !important;
    padding: 6px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-size: 14px !important;
    border: none !important;
}

/* Remove */
.hep-remove-cell {
    width: 50px !important;
    border:none !important;
}

.hep-remove-item {
    color: #1f2937 !important;
    text-decoration: none !important;
    font-size: 20px !important;
    display: inline-block !important;
    font-weight: 400 !important;
}

.hep-remove-item:hover {
    color: #ef4444 !important;
}

/* Coupon Section - Border #ccc, 12px radius, button on right */
.hep-coupon-section {
    padding: 20px !important;
    display: flex !important;
    gap: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    align-items: stretch !important;
    overflow: hidden !important;
}

.hep-coupon-input {
    flex: 1 !important;
    padding: 14px 20px !important;
    border: none !important;
    font-size: 14px !important;
    background: #f9fafb !important;
    color: #6b7280 !important;
    margin: 0 !important;
}

.hep-coupon-input::placeholder {
    color: #9ca3af !important;
}

.hep-coupon-input:focus {
    outline: none !important;
    background: #ffffff !important;
}

.hep-apply-coupon {
    padding: 12px 24px !important;
    font-size: 13px !important;
    background: #dbeafe !important;
    color: #1e40af !important;
    border: none !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    width: auto !important;
    margin: 0 !important;
}

.hep-apply-coupon:hover {
    background: #bfdbfe !important;
}

/* Order Summary Card - 12px border radius */
.hep-cart-card:has(.hep-order-summary-title) {
    border-radius: 12px !important;
}

.hep-order-summary-title {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 24px 30px !important;
    background: #f3f4f6 !important;
    text-align: center !important;
    color: #1f2937 !important;
    border-radius: 12px 12px 0 0 !important;
}

.hep-order-summary {
    padding: 30px !important;
    background: #f3f4f6 !important;
}

.hep-summary-row {
    display: flex !important;
    justify-content: space-between !important;
    padding: 12px 0 !important;
    font-size: 15px !important;
}

.hep-summary-row span:first-child {
    color: #6b7280 !important;
    font-weight: 500 !important;
}

.hep-summary-row span:last-child {
    font-weight: 700 !important;
    color: #1f2937 !important;
}

.hep-summary-row.hep-discount {
    color: #16a34a !important;
}

.hep-summary-row.hep-discount span:first-child {
    color: #16a34a !important;
}

.hep-summary-row.hep-discount span:last-child {
    color: #16a34a !important;
}

.hep-summary-row.hep-total {
    border-top: 1px solid #d1d5db !important;
    margin-top: 12px !important;
    padding-top: 16px !important;
    font-size: 16px !important;
}

.hep-checkout-actions {
    padding: 30px !important;
    background: #f3f4f6 !important;
    border-radius: 0 0 12px 12px !important;
    text-align: left !important;
}

.hep-checkout-btn {
    display: inline-block !important;
    width: auto !important;
    max-width: 320px !important;
    padding: 14px 32px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    background: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer !important;
}

.hep-checkout-btn:hover {
    background: #1d4ed8 !important;
}

/* Buttons */
.hep-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.hep-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.hep-btn-secondary {
    background: #dbeafe;
    color: #2563eb;
}

/* Empty Cart */
.hep-empty-cart-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.hep-empty-cart {
    text-align: center;
    padding: 80px 40px;
    background: transparent;
    border-radius: 0;
}

.hep-empty-cart-icon {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hep-empty-cart-icon svg {
    width: 180px;
    height: 180px;
}

.hep-empty-cart-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.hep-empty-cart-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 32px;
    display: none;
}

.hep-shop-btn {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
}

/* Error */
.hep-error {
    text-align: center;
    padding: 16px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ========================================
   RESPONSIVE DESIGN - Mobile First Approach
   ======================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .hep-woocommerce-cart {
        padding: 20px 15px !important;
    }

    /* Progress Steps - Always One Row */
    .hep-progress-steps {
        gap: 8px !important;
        padding: 20px 15px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important; /* IE/Edge */
    }

    .hep-progress-steps::-webkit-scrollbar {
        display: none !important; /* Chrome/Safari */
    }

    .hep-progress-step {
        gap: 6px !important;
        min-width: 100px !important;
        flex-shrink: 0 !important;
    }

    .hep-progress-circle {
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }

    .hep-progress-content h4 {
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    .hep-progress-content p {
        display: none !important;
    }

    /* Cart Card */
    .hep-cart-card {
        padding: 20px !important;
    }

    /* Cart Table - Simplified for Tablet */
    .hep-cart-table th,
    .hep-cart-table td {
        padding: 12px 8px !important;
        font-size: 13px !important;
    }

    .hep-product-info {
        gap: 12px !important;
    }

    .hep-product-info img {
        width: 55px !important;
        height: 55px !important;
    }

    .hep-product-details h4 {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    /* Coupon Section */
    .hep-coupon-section {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .hep-coupon-input {
        border-radius: 12px 12px 0 0 !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    .hep-apply-coupon {
        border-radius: 0 0 12px 12px !important;
        width: 100% !important;
        padding: 14px 24px !important;
    }

    /* Order Summary */
    .hep-order-summary {
        padding: 20px !important;
    }

    .hep-checkout-actions {
        padding: 20px !important;
    }

    .hep-checkout-btn {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Empty Cart */
    .hep-empty-cart {
        padding: 60px 20px !important;
    }

    .hep-empty-cart-icon svg {
        width: 140px !important;
        height: 140px !important;
    }
}

/* Mobile (576px and below) - Card-Based Layout */
@media (max-width: 576px) {
    .hep-woocommerce-cart {
        padding: 15px 10px !important;
    }

    /* Progress Steps - Compact One Row */
    .hep-progress-steps {
        padding: 12px 10px !important;
        gap: 5px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .hep-progress-steps::-webkit-scrollbar {
        display: none !important;
    }

    .hep-progress-step {
        gap: 4px !important;
        min-width: 85px !important;
        flex-shrink: 0 !important;
    }

    .hep-progress-circle {
        width: 34px !important;
        height: 34px !important;
        font-size: 12px !important;
    }

    .hep-progress-content h4 {
        font-size: 10px !important;
        white-space: nowrap !important;
        font-weight: 600 !important;
    }

    .hep-progress-content p {
        display: none !important;
    }

    /* Cart Card */
    .hep-cart-card {
        padding: 12px !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
    }

    /* Cart Table - Transform to Cards */
    .hep-cart-table {
        display: block !important;
    }

    .hep-cart-table thead {
        display: none !important;
    }

    .hep-cart-table tbody {
        display: block !important;
    }

    .hep-cart-table tr {
        display: block !important;
        margin-bottom: 12px !important;
        padding: 14px !important;
        background: #ffffff !important;
        border-radius: 10px !important;
        border: 1px solid #e5e7eb !important;
        position: relative !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    }

    .hep-cart-table tr:last-child {
        margin-bottom: 0 !important;
    }

    .hep-cart-table td {
        display: block !important;
        text-align: right !important;
        padding: 6px 0 !important;
        border: none !important;
    }

    /* Product Cell - Prominent Display */
    .hep-product-cell {
        width: 100% !important;
        padding: 0 0 12px 0 !important;
        border-bottom: 1px solid #f3f4f6 !important;
        margin-bottom: 10px !important;
    }

    .hep-product-info {
        flex-direction: row-reverse !important;
        gap: 12px !important;
        align-items: flex-start !important;
    }

    .hep-product-info img {
        width: 70px !important;
        height: 70px !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }

    .hep-product-details {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .hep-product-details h4 {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin: 0 !important;
        font-weight: 600 !important;
    }

    /* Price, Quantity, Subtotal - Clean Row Layout */
    .hep-price-cell,
    .hep-quantity-cell,
    .hep-subtotal-cell {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f9fafb !important;
    }

    .hep-subtotal-cell {
        border-bottom: none !important;
        padding-top: 10px !important;
        margin-top: 4px !important;
        border-top: 1px solid #e5e7eb !important;
    }

    .hep-price-cell::before,
    .hep-quantity-cell::before,
    .hep-subtotal-cell::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #6b7280 !important;
        font-size: 13px !important;
    }

    .hep-price-cell::before {
        content: 'قیمت واحد' !important;
    }

    .hep-quantity-cell::before {
        content: 'تعداد' !important;
    }

    .hep-subtotal-cell::before {
        content: 'جمع کل' !important;
        color: #1f2937 !important;
    }

    .hep-subtotal-cell {
        font-weight: 700 !important;
        font-size: 15px !important;
    }

    /* Remove Button - Top Left Corner */
    .hep-remove-cell {
        position: absolute !important;
        top: 12px !important;
        left: 12px !important;
        width: auto !important;
        padding: 0 !important;
    }

    .hep-remove-item {
        font-size: 22px !important;
        padding: 4px 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #fee2e2 !important;
        color: #ef4444 !important;
        border-radius: 6px !important;
        line-height: 1 !important;
        transition: all 0.2s !important;
    }

    .hep-remove-item:hover {
        background: #fecaca !important;
        color: #dc2626 !important;
    }

    /* Quantity Input - Better Touch Target */
    .hep-quantity-input,
    .hep-quantity-cell .quantity input[type="number"] {
        width: 70px !important;
        padding: 10px !important;
        font-size: 14px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 6px !important;
        text-align: center !important;
    }

    .hep-quantity-cell .quantity {
        justify-content: flex-end !important;
    }

    /* Coupon Section - Full Width */
    .hep-coupon-section {
        flex-direction: column !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        border: 1px solid #e5e7eb !important;
    }

    .hep-coupon-input {
        padding: 14px 16px !important;
        font-size: 14px !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    .hep-apply-coupon {
        padding: 14px 16px !important;
        font-size: 14px !important;
        border-radius: 0 !important;
        width: 100% !important;
        border: none !important;
    }

    /* Order Summary - Clean Mobile Design */
    .hep-order-summary-title {
        padding: 16px 14px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
    }

    .hep-order-summary {
        padding: 16px 14px !important;
    }

    .hep-summary-row {
        padding: 10px 0 !important;
        font-size: 14px !important;
    }

    .hep-summary-row.hep-total {
        font-size: 16px !important;
        padding-top: 12px !important;
    }

    /* Checkout Actions */
    .hep-checkout-actions {
        padding: 16px 14px !important;
        text-align: center !important;
    }

    .hep-checkout-btn {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 24px !important;
        font-size: 15px !important;
        font-weight: 700 !important;
    }

    /* Empty Cart */
    .hep-empty-cart {
        padding: 40px 20px !important;
    }

    .hep-empty-cart-icon svg {
        width: 120px !important;
        height: 120px !important;
    }

    .hep-empty-cart-title {
        font-size: 20px !important;
    }

    .hep-shop-btn {
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* Extra Small Mobile (400px and below) - Ultra Compact */
@media (max-width: 400px) {
    .hep-woocommerce-cart {
        padding: 12px 8px !important;
    }

    /* Progress Steps - Ultra Compact */
    .hep-progress-steps {
        padding: 10px 8px !important;
        gap: 4px !important;
    }
    table.hep-cart-table td{
        padding-right:35px !important;
    }

    .hep-progress-step {
        min-width: 75px !important;
    }

    .hep-progress-circle {
        width: 30px !important;
        height: 30px !important;
        font-size: 11px !important;
    }

    .hep-progress-content h4 {
        font-size: 9px !important;
    }

    /* Cart Card */
    .hep-cart-card {
        padding: 10px !important;
    }

    .hep-cart-table tr {
        padding: 12px !important;
    }

    /* Product Display */
    .hep-product-info img {
        width: 60px !important;
        height: 60px !important;
    }

    .hep-product-details h4 {
        font-size: 13px !important;
    }

    /* Remove Button */
    .hep-remove-cell {
        top: 10px !important;
        left: 10px !important;
    }

    .hep-remove-item {
        font-size: 20px !important;
        padding: 3px 6px !important;
    }

    /* Order Summary */
    .hep-order-summary,
    .hep-checkout-actions {
        padding: 14px 12px !important;
    }

    .hep-order-summary-title {
        padding: 14px 12px !important;
        font-size: 14px !important;
    }

    .hep-summary-row {
        font-size: 13px !important;
    }

    .hep-summary-row.hep-total {
        font-size: 15px !important;
    }
}

/* WooCommerce Quantity Override */
.hep-quantity-cell .quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Accessibility */
.hep-coupon-input:focus,
.hep-quantity-input:focus,
.hep-btn:focus,
.hep-checkout-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}