/**
 * DesiDukaan - Page Components CSS
 * Consolidated inline styles from various pages
 * Created: 2026-01-26
 */

/* ==========================================================================
   1. ALERT & MESSAGE STYLES (used across all pages)
   ========================================================================== */

.alert {
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* Login/Register Messages */
.login-message,
.register-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================================================
   2. BUTTON STATES
   ========================================================================== */

.tf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-password {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.toggle-password:hover {
    opacity: 0.7;
}

/* ==========================================================================
   3. OTP INPUT STYLES (Login/Register)
   ========================================================================== */

.otp-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 20px 0;
}

.otp-inputs {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    justify-content: center;
    align-items: center;
}

.otp-input {
    width: 45px;
    height: 45px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    outline: none;
    background: transparent;
    color: #333;
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: var(--primary-color, #2c5f41);
    box-shadow: 0 0 0 2px rgba(44, 95, 65, 0.1);
}

.otp-input:valid {
    border-color: var(--success-color, #28a745);
}

/* OTP Info Text */
.otp-info p {
    color: #6c757d;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Mobile responsive OTP */
@media (max-width: 480px) {
    .otp-inputs {
        gap: 6px;
        max-width: 280px;
    }
    .otp-input {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .otp-inputs {
        gap: 4px;
        max-width: 240px;
    }
    .otp-input {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ==========================================================================
   4. LOGIN TABS STYLING
   ========================================================================== */

.login-toggle .tf-tabs {
    margin-bottom: 20px;
}

.login-toggle .on-the-tabs {
    display: flex;
    border-bottom: 1px solid #e1e5e9;
}

.login-toggle .tab-title-item {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.login-toggle .tab-title-item.active {
    color: var(--primary-color, #2c5f41);
    border-bottom-color: var(--primary-color, #2c5f41);
}

.login-toggle .tab-title-item:hover {
    color: var(--primary-color, #2c5f41);
}

.tab-content-item {
    display: none;
}

.tab-content-item.active {
    display: block;
}

/* ==========================================================================
   5. MOBILE INPUT WITH PREFIX (Phone Number)
   ========================================================================== */

.mobile-input-field .input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
}

.mobile-input-field .country-prefix {
    background: #f8f9fa;
    padding: 12px 16px;
    border-right: 1px solid #e1e5e9;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.mobile-input-field input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    outline: none;
    font-size: 14px;
}

.mobile-input-field input:focus {
    border: none;
    outline: none;
}

.mobile-input-field .input-with-prefix:focus-within {
    border-color: var(--primary-color, #2c5f41);
    box-shadow: 0 0 0 2px rgba(44, 95, 65, 0.1);
}

/* ==========================================================================
   6. ADDRESS CARD STYLES (Checkout, Cart, Account)
   ========================================================================== */

.address-card {
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.address-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

.address-card.selected {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.address-card.selected::after {
    content: '\2713';
    position: absolute;
    top: 10px;
    right: 15px;
    background: #007bff;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.address-info h6 {
    margin: 0 0 8px 0;
    color: #333;
    font-weight: 600;
}

.address-info p {
    margin: 0 0 4px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.address-type {
    background-color: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.btn-change-address {
    background: none;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    float: right;
    margin-top: -40px;
}

.btn-change-address:hover {
    background: #007bff;
    color: white;
}

.address-loading {
    color: #666;
    font-style: italic;
}

.no-addresses-message {
    text-align: center;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.no-addresses-message p {
    color: #6c757d;
    margin-bottom: 15px;
}

/* ==========================================================================
   7. CART ATTRIBUTE STYLES
   ========================================================================== */

.selected-attributes {
    margin-top: 8px;
}

.attribute-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
}

.attribute-label {
    font-weight: 600;
    color: #666;
    margin-right: 8px;
    text-transform: capitalize;
}

.attribute-value {
    color: #333;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Attribute Master Styles */
.attribute-master {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.attribute-master-title {
    font-size: 11px;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attribute-master-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 10px;
}

.attribute-master-item:last-child {
    margin-bottom: 0;
}

.attr-name {
    font-weight: 600;
    color: #666;
    margin-right: 8px;
    text-transform: capitalize;
    min-width: 60px;
}

.attr-values {
    color: #555;
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    border: 1px solid #e9ecef;
}

/* ==========================================================================
   8. EMPTY STATE STYLES
   ========================================================================== */

.empty-cart-message,
.empty-wishlist-message,
.empty-orders-message {
    text-align: center;
    padding: 40px 20px;
}

.empty-cart-message i,
.empty-wishlist-message i,
.empty-orders-message i {
    color: #ccc;
    margin-bottom: 20px;
}

.empty-cart-message h4,
.empty-wishlist-message h4,
.empty-orders-message h4 {
    color: #333;
    margin-bottom: 10px;
}

.empty-cart-message p,
.empty-wishlist-message p,
.empty-orders-message p {
    color: #666;
    margin-bottom: 20px;
}

/* ==========================================================================
   9. COUPON/DISCOUNT STYLES
   ========================================================================== */

.box-discount {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.box-discount.applied {
    border-color: #28a745;
    background-color: #f8fff9;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.box-discount.disabled {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.box-discount.disabled .apply-coupon-btn {
    background-color: #6c757d !important;
    cursor: not-allowed;
}

.coupon-message {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   10. LOCATION/CHANGE AREA STYLES
   ========================================================================== */

.nav-location {
    margin-right: 15px;
}

.nav-location .nav-icon-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.nav-location .nav-icon-item:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.nav-location .nav-icon-item:hover svg path {
    stroke: white;
}

.nav-location .nav-icon-item svg {
    width: 18px;
    height: 18px;
}

#current-location-text {
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .nav-location {
        margin-right: 8px;
    }
    #current-location-text {
        display: none;
    }
    .nav-location .nav-icon-item {
        padding: 8px;
        min-width: auto;
    }
}

/* ==========================================================================
   11. MODAL STYLES
   ========================================================================== */

.modal-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
}

.modal-custom .modal-content {
    position: relative;
    background: white;
    margin: 2% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    max-height: 95vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-custom .modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-custom .modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-custom .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-custom .modal-close:hover {
    color: #333;
}

.modal-custom .modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(95vh - 120px);
}

/* ==========================================================================
   12. FORM STYLES
   ========================================================================== */

.form-group,
.ion-form-group {
    margin-bottom: 15px;
}

.form-group input,
.ion-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: #f8f9fa;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.ion-input:focus {
    outline: none;
    border-color: var(--secondary-color, #007bff);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    background: white;
}

.ion-button {
    background: var(--secondary-color, #007bff);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.ion-button:hover {
    background: var(--secondary-color-dark, #0056b3);
    transform: translateY(-1px);
}

.ion-button:active {
    transform: translateY(0);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ==========================================================================
   13. BUTTON STYLES
   ========================================================================== */

.btn-outline {
    border: 1px solid #007bff;
    color: #007bff;
    background: transparent;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-save,
.btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-save {
    background: var(--secondary-color, #007bff);
    color: white;
}

.btn-save:hover {
    background: var(--secondary-color-hover, #0056b3);
}

.btn-cancel {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* ==========================================================================
   14. TOASTER NOTIFICATION STYLES
   ========================================================================== */

.toaster-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toaster {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toasterSlideIn 0.3s ease;
}

.toaster.success {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.toaster.error {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.toaster.info {
    background-color: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

@keyframes toasterSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   15. WISHLIST STYLES
   ========================================================================== */

.wishlist.btn-icon-action.active .icon {
    color: #ff4757 !important;
}

.wishlist.btn-icon-action.active .icon::before {
    content: "\e9da";
}

.card-product .list-product-btn {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.card-product:hover .list-product-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.card-product .wishlist.btn-icon-action:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease, color 0.2s ease;
}

#empty-wishlist .icon {
    opacity: 0.5;
}

/* ==========================================================================
   16. PASSWORD RESET SECTION
   ========================================================================== */

#password-reset-section .heading h5 {
    color: #333;
    margin-bottom: 8px;
}

#password-reset-section .heading p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   17. ERROR MESSAGE STYLES
   ========================================================================== */

.error-message {
    text-align: center;
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
}

.error-message button {
    margin-top: 10px;
}

/* ==========================================================================
   18. RESPONSIVE ADDRESS STYLES
   ========================================================================== */

@media (max-width: 768px) {
    .address-card {
        padding: 12px;
    }

    .address-card.selected::after {
        top: 8px;
        right: 8px;
    }

    .btn-change-address {
        float: none;
        margin-top: 10px;
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   19. PRODUCT CARD IMAGE FIXES (with !important overrides)
   ========================================================================== */

/* Product Card Container - Override styles.css */
.card-product .card-product-wrapper {
    position: relative !important;
    background: #f8f9fa !important;
    border-radius: 12px 12px 0 0 !important;
    overflow: hidden !important;
    aspect-ratio: 1 / 1 !important;
    min-height: 200px !important;
    padding: 0 !important;
}

/* Product Image Link Container */
.card-product .product-img {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 20px !important;
    background: #f8f9fa !important;
}

/* Product Images - Proper sizing and centering */
.card-product .product-img img.img-product {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    transition: transform 0.4s ease !important;
    margin: 0 auto !important;
    display: block !important;
}

.card-product:hover .product-img img.img-product {
    transform: scale(1.08) !important;
}

/* Hide hover image completely */
.card-product .product-img img.img-hover {
    display: none !important;
    position: absolute !important;
    opacity: 0 !important;
}

/* Ensure quick action buttons are properly positioned */
.card-product .list-product-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 50 !important;
}

/* Swiper Slide Product Cards */
.swiper-slide .card-product .card-product-wrapper {
    aspect-ratio: 1 / 1 !important;
    min-height: 200px !important;
}

/* Mobile responsive product cards */
@media (max-width: 768px) {
    .card-product .card-product-wrapper {
        min-height: 180px !important;
        aspect-ratio: 1 / 1 !important;
    }

    .card-product .product-img {
        padding: 15px !important;
    }
}

@media (max-width: 480px) {
    .card-product .card-product-wrapper {
        min-height: 150px !important;
    }

    .card-product .product-img {
        padding: 10px !important;
    }
}
