/* ═══════════════════════════════════════════════════════════
   THEME-02 E-COMMERCE CSS
   Premium, Modern & Mobile Responsive
   ═══════════════════════════════════════════════════════════ */

/* ─── Floating Cart & Wishlist Icons ──────────────────────── */
.ecom-floating-actions {
    position: fixed;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    z-index: 1020;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ecom-float-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
    position: relative;
    box-shadow: 0 8px 24px rgba(15,23,42,0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 2px solid rgba(255,255,255,0.2);
}

.ecom-float-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 32px rgba(15,23,42,0.28);
    color: #fff;
}

.ecom-float-cart {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.ecom-float-wishlist {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
}

.ecom-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

/* ─── Product Card E-Commerce Actions ─────────────────────── */
.ecom-product-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.6rem;
}

.ecom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1.2;
}

.ecom-btn-cart {
    background: var(--theme-gradient-accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(15,23,42,0.15);
}

.ecom-btn-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15,23,42,0.22);
    color: #fff;
}

.ecom-btn-buy {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 6px 16px rgba(5,150,105,0.2);
}

.ecom-btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(5,150,105,0.3);
    color: #fff;
}

.ecom-btn-wish {
    background: #fff;
    color: #64748b;
    border: 1px solid rgba(148,163,184,0.4);
    padding: 0.45rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.ecom-btn-wish:hover,
.ecom-btn-wish.is-wishlisted {
    color: #e11d48;
    border-color: #e11d48;
    background: #fff1f2;
}

.ecom-btn-wish.is-wishlisted i {
    font-weight: 900;
}

/* ─── Cart Page ───────────────────────────────────────────── */
.ecom-page-section {
    padding: 50px 0 70px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    min-height: 60vh;
}

.ecom-page-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.ecom-page-subtitle {
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.ecom-card {
    background: #fff;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
    overflow: hidden;
}

.ecom-card-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(148,163,184,0.2);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ecom-card-body {
    padding: 1rem 1.2rem;
}

/* Cart Items */
.ecom-cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(148,163,184,0.15);
    align-items: center;
}

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

.ecom-cart-thumb {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(148,163,184,0.2);
    flex-shrink: 0;
}

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

.ecom-cart-name {
    font-weight: 650;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ecom-cart-price {
    font-weight: 800;
    color: #0f172a;
    font-size: 0.95rem;
}

.ecom-cart-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(148,163,184,0.4);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}

.ecom-cart-qty button {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.ecom-cart-qty button:hover {
    background: rgba(148,163,184,0.15);
}

.ecom-cart-qty span {
    width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color);
}

.ecom-cart-line-total {
    font-weight: 800;
    font-size: 1rem;
    color: #0f172a;
    min-width: 80px;
    text-align: right;
    flex-shrink: 0;
}

.ecom-cart-remove {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.ecom-cart-remove:hover {
    color: #ef4444;
}

/* Cart Summary */
.ecom-summary {
    position: sticky;
    top: 90px;
}

.ecom-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    font-size: 0.9rem;
    color: #475569;
}

.ecom-summary-row.total {
    border-top: 2px solid rgba(148,163,184,0.25);
    margin-top: 0.3rem;
    padding-top: 0.75rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.ecom-checkout-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--theme-gradient-accent);
    box-shadow: 0 12px 28px rgba(15,23,42,0.2);
    transition: all 0.25s ease;
    text-decoration: none;
    margin-top: 1rem;
}

.ecom-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15,23,42,0.28);
    color: #fff;
}

.ecom-continue-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid rgba(148,163,184,0.4);
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color);
    background: #fff;
    text-decoration: none;
    margin-top: 0.6rem;
    transition: all 0.2s ease;
}

.ecom-continue-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* Empty State */
.ecom-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.ecom-empty-icon {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.ecom-empty-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.ecom-empty-text {
    color: #64748b;
    font-size: 0.92rem;
    margin-bottom: 1.2rem;
}

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

.ecom-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    position: relative;
    padding: 0.5rem 1rem;
}

.ecom-step.active {
    color: var(--secondary-color);
}

.ecom-step.completed {
    color: #059669;
}

.ecom-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    background: #e2e8f0;
    color: #64748b;
    flex-shrink: 0;
}

.ecom-step.active .ecom-step-num {
    background: var(--theme-gradient-accent);
    color: #fff;
}

.ecom-step.completed .ecom-step-num {
    background: #059669;
    color: #fff;
}

.ecom-step-line {
    width: 40px;
    height: 2px;
    background: #e2e8f0;
}

.ecom-step.completed + .ecom-step-line {
    background: #059669;
}

.ecom-form-label {
    font-size: 0.85rem;
    font-weight: 650;
    color: #334155;
    margin-bottom: 0.35rem;
}

.ecom-form-input {
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.38);
    padding: 0.6rem 0.85rem;
    font-size: 0.92rem;
    color: var(--text-color);
    background: #fff;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ecom-form-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--secondary-rgb), 0.12);
    outline: none;
}

.ecom-form-textarea {
    min-height: 80px;
    resize: vertical;
}

.ecom-payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ecom-payment-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148,163,184,0.3);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.ecom-payment-option:hover {
    border-color: var(--secondary-color);
    background: #f0f4ff;
}

.ecom-payment-option.selected {
    border-color: var(--secondary-color);
    background: rgba(var(--secondary-rgb), 0.05);
    box-shadow: 0 0 0 2px rgba(var(--secondary-rgb), 0.15);
}

.ecom-payment-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ecom-payment-icon.razorpay {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
}

.ecom-payment-icon.cod {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.ecom-payment-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-color);
}

.ecom-payment-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.1rem;
}

/* Checkout Review Items */
.ecom-review-item {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(148,163,184,0.12);
}

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

.ecom-review-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(148,163,184,0.2);
    flex-shrink: 0;
}

.ecom-review-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.ecom-review-qty {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.ecom-review-price {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
}

/* ─── Order Success Page ──────────────────────────────────── */
.ecom-success-wrap {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.ecom-success-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    font-size: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    box-shadow: 0 12px 30px rgba(5,150,105,0.25);
    animation: ecom-pulse 2s infinite;
}

@keyframes ecom-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.ecom-success-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.ecom-success-order-num {
    display: inline-block;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 0.4rem 1.2rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #166534;
    margin-bottom: 1rem;
}

.ecom-success-text {
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ─── Wishlist Page ───────────────────────────────────────── */
.ecom-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.ecom-wishlist-card {
    background: #fff;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15,23,42,0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ecom-wishlist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(15,23,42,0.12);
}

.ecom-wishlist-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #ffffff;
}

.ecom-wishlist-body {
    padding: 0.9rem;
    text-align: center;
}

.ecom-wishlist-name {
    font-weight: 650;
    font-size: 0.92rem;
    color: var(--text-color);
    margin-bottom: 0.35rem;
}

.ecom-wishlist-price {
    font-weight: 800;
    color: #0f172a;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
}

.ecom-wishlist-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

/* ─── Toast Notifications ─────────────────────────────────── */
.ecom-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ecom-toast {
    min-width: 280px;
    max-width: 380px;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 14px;
    padding: 0.8rem 1rem;
    box-shadow: 0 12px 30px rgba(15,23,42,0.15);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: ecom-toast-in 0.3s ease;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color);
}

.ecom-toast.success {
    border-left: 4px solid #10b981;
}

.ecom-toast.error {
    border-left: 4px solid #ef4444;
}

.ecom-toast-icon {
    font-size: 1.2rem;
}

.ecom-toast.success .ecom-toast-icon {
    color: #10b981;
}

.ecom-toast.error .ecom-toast-icon {
    color: #ef4444;
}

@keyframes ecom-toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes ecom-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ─── Header Cart/Wishlist Links ──────────────────────────── */
.ecom-nav-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.ecom-nav-icon:hover {
    background: rgba(148,163,184,0.12);
    color: var(--secondary-color);
}

.ecom-nav-badge {
    position: absolute;
    top: 0;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ecom-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.5rem;
}

/* ─── Mobile Responsive ───────────────────────────────────── */
@media (max-width: 767.98px) {
    .ecom-floating-actions {
        bottom: 20px;
        right: 14px;
        top: auto;
        transform: none;
    }

    .ecom-float-btn {
        width: 44px;
        height: 44px;
        font-size: 1.05rem;
    }

    .ecom-cart-item {
        display: grid;
        grid-template-columns: 70px 1fr;
        grid-template-rows: auto auto;
        gap: 0.8rem;
        align-items: start;
        position: relative;
        padding: 1.2rem 0;
    }

    .ecom-cart-thumb {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 70px;
        height: 70px;
    }

    .ecom-cart-info {
        grid-column: 2;
        grid-row: 1;
        padding-right: 30px;
    }

    .ecom-cart-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
    }

    .ecom-cart-qty {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        margin-top: 0.25rem;
    }

    .ecom-cart-line-total {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        align-self: center;
        text-align: right;
        font-size: 0.95rem;
        font-weight: 800;
        min-width: auto;
    }

    .ecom-cart-remove {
        position: absolute;
        top: 1rem;
        right: 0;
    }

    .ecom-checkout-steps {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .ecom-step {
        font-size: 0.78rem;
        padding: 0.3rem 0.5rem;
    }

    .ecom-step-line {
        width: 20px;
    }

    .ecom-toast {
        min-width: 260px;
        max-width: calc(100vw - 40px);
    }

    .ecom-wishlist-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    .ecom-page-title {
        font-size: 1.5rem;
    }

    .ecom-cart-qty button {
        width: 30px;
        height: 30px;
    }

    .ecom-cart-qty span {
        width: 30px;
        font-size: 0.82rem;
    }
}
