/* NovoShop Cart Styles - Redesigned to match novomode.com with Redux colors */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

.novoshop-cart-wrapper {
    background: #ffffff;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

/* Redux Color Variables Integration - Uses Global Redux Colors */

/* Redux Colors are handled by the global Redux framework */

/* ============================================
   FOUC PREVENTION & LOADING STATES
   ============================================ */

/* Prevent layout shift during loading */
.novoshop-cart-wrapper {
    min-height: 400px;
    position: relative;
}

/* Loading state styling */
.novoshop-cart-wrapper .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.novoshop-cart-wrapper .loading span {
    color: #666;
    font-size: 16px;
    margin-right: 10px;
}

/* Smooth content reveal */
.novoshop-cart-wrapper:not(.loaded) {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.novoshop-cart-wrapper.loaded {
    opacity: 1;
}

/* ============================================
   MODERN FORM INPUT STYLING
   ============================================ */

/* Input Fields - Modern & Sleek */
.novoshop-cart-wrapper input[type="text"],
.novoshop-cart-wrapper input[type="email"],
.novoshop-cart-wrapper input[type="tel"],
.novoshop-cart-wrapper input[type="number"],
.novoshop-cart-wrapper input[type="password"],
.novoshop-cart-wrapper input[type="url"],
.novoshop-cart-wrapper input[type="search"],
.novoshop-cart-wrapper textarea,
.novoshop-cart-wrapper select {
    width: 100%;
    padding: 16px 20px;
    
    border-radius: 12px;
    font-size: 16px;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Input Focus States */
.novoshop-cart-wrapper input:focus,
.novoshop-cart-wrapper textarea:focus,
.novoshop-cart-wrapper select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.1);
    transform: translateY(-1px);
    background: #fefefe;
}

/* Input Hover States */
.novoshop-cart-wrapper input:hover,
.novoshop-cart-wrapper textarea:hover,
.novoshop-cart-wrapper select:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Placeholder Styling */
.novoshop-cart-wrapper input::placeholder,
.novoshop-cart-wrapper textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
    transition: color 0.3s ease;
}

.novoshop-cart-wrapper input:focus::placeholder,
.novoshop-cart-wrapper textarea:focus::placeholder {
    color: #6b7280;
}

/* Select Dropdown Styling */
.novoshop-cart-wrapper select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Textarea Specific Styling */
.novoshop-cart-wrapper textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Input Groups */
.novoshop-cart-wrapper .input-group {
    position: relative;
    margin-bottom: 20px;
}

.novoshop-cart-wrapper .input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Icons */
.novoshop-cart-wrapper .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.novoshop-cart-wrapper input:focus + .input-icon {
    color: var(--primary-color);
}

/* Validation States */
.novoshop-cart-wrapper .input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.novoshop-cart-wrapper .input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}

/* Error Messages */
.novoshop-cart-wrapper .input-error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.novoshop-cart-wrapper .input-error-message::before {
    content: "⚠";
    font-size: 16px;
}

/* Success Messages */
.novoshop-cart-wrapper .input-success-message {
    color: #10b981;
    font-size: 14px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.novoshop-cart-wrapper .input-success-message::before {
    content: "✓";
    font-size: 16px;
    font-weight: bold;
}

/* Disabled States */
.novoshop-cart-wrapper input:disabled,
.novoshop-cart-wrapper textarea:disabled,
.novoshop-cart-wrapper select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Readonly States */
.novoshop-cart-wrapper input[readonly],
.novoshop-cart-wrapper textarea[readonly] {
    background: #f9fafb;
    color: #6b7280;
    cursor: default;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .novoshop-cart-wrapper input[type="text"],
    .novoshop-cart-wrapper input[type="email"],
    .novoshop-cart-wrapper input[type="tel"],
    .novoshop-cart-wrapper input[type="number"],
    .novoshop-cart-wrapper input[type="password"],
    .novoshop-cart-wrapper input[type="url"],
    .novoshop-cart-wrapper input[type="search"],
    .novoshop-cart-wrapper textarea,
    .novoshop-cart-wrapper select {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 10px;
    }
    
    .novoshop-cart-wrapper .input-icon {
        right: 14px;
        font-size: 16px;
    }
}

.novoshop-cart-wrapper .container {
    max-width: 1620px;
    margin: 0 auto;
    padding: 20px;
}

/* Checkout Progress Bar */
.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.novoshop-cart-wrapper .progress-step.completed .step-circle {
    background: var(--primary-color) !important;
    color: white !important;
}

.checkmark {
    font-size: 18px;
    font-weight: bold;
}

.step-label {
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 500;
}

.progress-line {
    width: 100px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 20px;
    margin-top: -20px;
}

/* Cart Content Wrapper */
.cart-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

/* Right Panel: Product Details */
.cart-products-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    background: #f9fafb;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Products Table */
.products-table {
    padding: 0;
}

.table-headers {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 14px;
}

.header-cell {
    text-align: center;
}

/* Products List */
.products-list {
    padding: 0;
}

.product-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}

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

.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.product-details {
    flex: 1;
}

.product-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-color);
    line-height: 1.4;
}

.product-name a {
    color: inherit;
    text-decoration: none;
}

.product-name a:hover {
    color: var(--primary-color);
}

.novoshop-cart-wrapper .product-price,
.novoshop-cart-wrapper .product-subtotal {
    text-align: center;
    font-weight: 600;
    color: var(--primary-color) !important;
    font-size: 16px;
}

.product-quantity {
    display: flex;
    justify-content: center;
    align-items: center;
}

.quantity {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.quantity input {
    width: 50px;
    text-align: center;
    border: none;
    padding: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-color);
    background: transparent;
    outline: none;
}

.quantity .qty-btn {
    background: #f3f4f6;
    color: var(--secondary-color);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity .qty-btn:hover {
    background: #e5e7eb;
}

.quantity .qty-btn.minus {
    border-radius: 6px 0 0 6px;
}

.quantity .qty-btn.plus {
    border-radius: 0 6px 6px 0;
}

.product-remove {
    position: absolute;
    top: 10px;
    left: 10px;
}

.product-remove .remove {
    color: #9ca3af;
    font-size: 20px;
    text-decoration: none;
    font-weight: bold;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.product-remove .remove:hover {
    color: white;
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.1);
}

/* Discount Section */
.discount-section {
    padding: 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.coupon-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.coupon-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    color: var(--secondary-color);
    background-color: #fff;
    transition: border-color 0.15s ease;
}

.coupon-input:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.apply-coupon-btn,
.update-cart-btn {
    background: #f3f4f6;
    color: var(--secondary-color);
    padding: 12px 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.apply-coupon-btn:hover,
.update-cart-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Left Panel: Order Summary */
.cart-summary-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

.summary-content {
    padding: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.summary-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.summary-value {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 600;
}

.discount-row .summary-value {
    color: var(--primary-color);
}

.total-row {
    background: #f9fafb;
    margin: 0 -20px;
    padding: 20px;
    border-top: 2px solid #e5e7eb;
    border-bottom: none;
}

.total-row .summary-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
}

.total-row .summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.shipping-note {
    font-size: 12px;
    color: #9ca3af;
    margin-top: -8px;
    margin-bottom: 8px;
    text-align: right;
}

/* Checkout Button */
.checkout-button-wrapper {
    padding: 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.novoshop-cart-wrapper .checkout-button-wrapper .button {
    width: 100%;
    background: var(--primary-color) !important;
    color: white !important;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(255, 102, 0, 0.2);
}

.novoshop-cart-wrapper .checkout-button-wrapper .button:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.3);
}


/* Responsive Design */
@media (max-width: 1024px) {
    .cart-content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-summary-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .checkout-progress {
        margin-bottom: 20px;
    }
    
    .progress-line {
        width: 60px;
        margin: 0 10px;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    .table-headers,
    .product-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .product-info {
        flex-direction: column;
        text-align: center;
    }
    
    .product-image {
        width: 100px;
        height: 100px;
    }
    
    .product-remove {
        position: static;
        order: -1;
        margin-bottom: 10px;
    }
    
}

@media (max-width: 480px) {
    .step-circle {
        width: 30px;
        height: 30px;
    }
    
    .checkmark {
        font-size: 14px;
    }
    
    .step-label {
        font-size: 10px;
    }
    
    .progress-line {
        width: 40px;
        margin: 0 5px;
    }
    
    .panel-header,
    .summary-content,
    .discount-section,
    .checkout-button-wrapper {
        padding: 15px;
    }
    
    .product-item {
        padding: 15px;
    }
    
    .product-image {
        width: 80px;
        height: 80px;
    }
}

/* Loading States */
.button.loading {
    position: relative;
    color: transparent !important;
}

.button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover Effects */
.product-item.hovered {
    background: rgba(255, 102, 0, 0.02);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Progress Bar Animation */
.progress-step.completed .step-circle.animate {
    animation: checkmarkPulse 0.6s ease-in-out;
}

@keyframes checkmarkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Summary Row Animation */
.summary-row {
    animation: slideInRight 0.5s ease-out forwards;
    opacity: 0;
    transform: translateX(20px);
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Smooth Transitions */
.product-item,
.summary-row,
.button,
.quantity .qty-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus States */
.coupon-input:focus,
.quantity input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

/* RTL Support */
.novoshop-cart-wrapper {
    direction: rtl;
}

.novoshop-cart-wrapper * {
    text-align: right;
}

.novoshop-cart-wrapper .product-info {
    flex-direction: row-reverse;
}

.novoshop-cart-wrapper .product-remove {
    left: auto;
    right: 10px;
}

.novoshop-cart-wrapper .floating-elements {
    right: auto;
    left: 20px;
}

@media (max-width: 768px) {
    .novoshop-cart-wrapper .floating-elements {
        left: 10px;
    }
}