/**
 * Product Page Checkout Styles
 */

.algeria-product-checkout-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.algeria-product-checkout-form {
    max-width: 100%;
}

/* Product Summary */
.algeria-product-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e4e8;
}

.algeria-product-summary .product-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.algeria-product-summary .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.algeria-product-summary .product-info {
    flex: 1;
}

.algeria-product-summary .product-name {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.algeria-product-summary .product-price {
    font-size: 20px;
    font-weight: 700;
    color: #007cba;
    margin-bottom: 15px;
}

.algeria-product-summary .product-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.algeria-product-summary .product-quantity label {
    font-weight: 600;
    margin: 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e1e4e8;
}

.qty-btn:active {
    background: #d1d4d8;
}

.qty-input {
    width: 50px;
    height: 35px;
    border: none;
    text-align: center;
    font-weight: 600;
    background: #fff;
}

/* Checkout Fields */
.algeria-checkout-fields {
    margin-bottom: 25px;
}

.algeria-checkout-fields .form-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

.algeria-checkout-fields .form-row {
    margin-bottom: 20px;
}

.algeria-checkout-fields label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.algeria-checkout-fields .required {
    color: #ff0000;
    margin-left: 3px;
}

.algeria-checkout-fields .input-text,
.algeria-checkout-fields .select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.algeria-checkout-fields .input-text:focus,
.algeria-checkout-fields .select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.algeria-checkout-fields .select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Order Summary */
.algeria-order-summary {
    margin-bottom: 25px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    overflow: hidden;
}

.algeria-order-summary .summary-header {
    background: #f8f9fa;
    padding: 15px;
    cursor: pointer;
    user-select: none;
}

.algeria-order-summary .summary-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.algeria-order-summary .summary-icon {
    font-size: 18px;
}

.algeria-order-summary .summary-toggle {
    margin-left: auto;
    font-size: 12px;
    color: #666;
}

.algeria-order-summary .summary-content {
    padding: 15px;
    background: #fff;
}

.algeria-order-summary .summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e1e4e8;
    margin-bottom: 10px;
}

.algeria-order-summary .summary-item .item-quantity {
    font-weight: 600;
    color: #666;
}

.algeria-order-summary .summary-item .item-name {
    flex: 1;
    font-size: 14px;
}

.algeria-order-summary .summary-item .item-price {
    font-weight: 600;
    color: #007cba;
}

.algeria-order-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.algeria-order-summary .summary-row.total-row {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #e1e4e8;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.algeria-order-summary .summary-row .total-price {
    color: #007cba;
    font-size: 20px;
}

/* Action Buttons */
.algeria-checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.algeria-checkout-actions .button {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.algeria-checkout-actions .add-to-cart-btn {
    background: #333;
    color: #fff;
}

.algeria-checkout-actions .add-to-cart-btn:hover {
    background: #222;
    color: #fff;
}

.algeria-checkout-actions .confirm-order-btn {
    background: #007cba;
    color: #fff;
}

.algeria-checkout-actions .confirm-order-btn:hover {
    background: #005a87;
    color: #fff;
}

.algeria-checkout-actions .confirm-order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.algeria-checkout-actions .whatsapp-order-btn {
    background: #25D366;
    color: #fff;
}

.algeria-checkout-actions .whatsapp-order-btn:hover {
    background: #1da851;
    color: #fff;
}

/* Loading Overlay */
.checkout-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.algeria-product-checkout-wrapper {
    position: relative;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.checkout-loading p {
    margin: 0;
    font-weight: 600;
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .algeria-product-checkout-wrapper {
        padding: 15px;
        margin: 15px 0;
    }

    .algeria-product-summary {
        flex-direction: column;
    }

    .algeria-product-summary .product-image {
        width: 100%;
        height: 200px;
    }

    .algeria-checkout-fields .input-text,
    .algeria-checkout-fields .select {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .algeria-checkout-actions {
        gap: 8px;
    }

    .algeria-checkout-actions .button {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* RTL Support */
html[dir="rtl"] .algeria-product-summary {
    flex-direction: row-reverse;
}

html[dir="rtl"] .algeria-checkout-fields label {
    text-align: right;
}

html[dir="rtl"] .algeria-checkout-fields .required {
    margin-left: 0;
    margin-right: 3px;
}

html[dir="rtl"] .algeria-order-summary .summary-header h4 {
    flex-direction: row-reverse;
}

html[dir="rtl"] .algeria-order-summary .summary-toggle {
    margin-left: 0;
    margin-right: auto;
}

