.view-details-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-details-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    font-size: 1.1rem;
}

.payment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.payment-form input,
.payment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.payment-form input:focus,
.payment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .view-details-btn {
        width: 100%;
    }
}


/* Logo Responsive Styles */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.auth-logo {
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .logo img {
        height: 45px;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .auth-modal-box {
        flex-direction: column;
        width: 95%;
        max-width: 500px;
    }
    
    .auth-info {
        width: 100%;
        padding: 30px 20px;
    }
    
    .auth-form-section {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 40px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
}


/* Logo Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Logo Responsive */
@media (max-width: 768px) {
    .hero img {
        width: 100px !important;
        height: 100px !important;
    }
}

@media (max-width: 480px) {
    .hero img {
        width: 80px !important;
        height: 80px !important;
    }
}


/* Professional Input Icons */
.input-with-icon {
    position: relative;
    margin-bottom: 15px;
}

.input-icon-img {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.auth-form label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.auth-btn i {
    font-size: 1rem;
}

/* Input Focus Effects */
.input-with-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 126, 185, 0.1);
}

.input-with-icon input:focus ~ .input-icon-img {
    opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .input-icon-img {
        left: 10px;
        width: 16px;
        height: 16px;
    }
    
    .input-with-icon input {
        padding-left: 35px !important;
    }
}

/* Emoji Icon Styling */
.input-icon-emoji {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.input-with-icon input:focus ~ .input-icon-emoji {
    opacity: 1;
}

@media (max-width: 480px) {
    .input-icon-emoji {
        left: 10px;
        font-size: 16px;
    }
}

/* Cart Icon Button in Header */
.cart-icon-btn {
    position: relative;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 126, 185, 0.3);
    pointer-events: auto !important;
    z-index: 1002;
}

.cart-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 126, 185, 0.4);
}

.cart-icon-btn i {
    font-size: 1.3rem;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (max-width: 768px) {
    .cart-icon-btn {
        width: 45px;
        height: 45px;
    }
    
    .cart-icon-btn i {
        font-size: 1.1rem;
    }
}

/* Cart Quantity Controls */
.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.qty-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

.qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--dark);
}

/* Cart Item Animation */
.cart-item {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Checkout Button Enhancement */
.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--success), #1e7e34);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* Add to Cart Success Animation */
@keyframes addToCartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-badge.pulse-animation {
    animation: addToCartPulse 0.5s ease;
}

/* CRITICAL LAYOUT FIXES */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 80px;
}

.page-content {
    flex: 1 0 auto;
}

/* HEADER - ENSURE CLICKABLE AND STICKY */
header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

header *,
.login-btn,
.cart-icon-btn,
.user-profile-header,
nav,
nav ul,
nav li,
nav a,
button {
    pointer-events: auto !important;
}

.login-btn,
.cart-icon-btn {
    z-index: 1002 !important;
    position: relative;
    cursor: pointer !important;
}

/* FOOTER - FIX POSITIONING */
footer {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
}

/* CART SIDEBAR */
.cart-sidebar {
    z-index: 2000 !important;
    pointer-events: auto !important;
}

.cart-sidebar * {
    pointer-events: auto !important;
}

/* PRODUCT IMAGES - CRITICAL FIX */
.product-img {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.product-img:hover img {
    transform: scale(1.05);
}

/* Cart Item Images */
.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

/* Admin Product Images */
.admin-product-container {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
}

.product-admin-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Global Image Styles */
img {
    max-width: 100%;
    height: auto;
    image-rendering: auto;
    -webkit-user-select: none;
    user-select: none;
}

/* FIX CART BADGE VISIBILITY */
.cart-badge {
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}


/* Professional Password Input Styling */
.password-input-container {
    position: relative;
    margin-bottom: 15px;
}

.password-input {
    width: 100%;
    padding: 12px 45px 12px 12px !important;
    border: 1.5px solid #f5b6c4;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.password-input:focus {
    border-color: #ff66a6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 102, 166, 0.1);
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: #ff66a6;
    background: rgba(255, 102, 166, 0.1);
}

.password-toggle-btn:focus {
    outline: 2px solid #ff66a6;
    outline-offset: 2px;
}

/* Product Admin Image Styling */
.product-image-container {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
    position: relative;
}

.product-admin-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
    display: block;
    margin: 0 auto;
}

.product-admin-image:hover {
    transform: scale(1.05);
}

/* Ensure product images display properly */
.product-img img,
.product-admin-image {
    background: #f5f5f5;
    min-height: 50px;
}

.product-img img[src=""],
.product-img img:not([src]),
.product-admin-image[src=""],
.product-admin-image:not([src]) {
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50"><rect fill="%23f5f5f5" width="50" height="50"/><text x="50%" y="50%" text-anchor="middle" dy=".3em" fill="%23999" font-size="10">No Image</text></svg>');
}

/* Admin Dashboard Enhancements */
.admin-stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.admin-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Order Status Enhancements */
.order-status-select {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.order-status-select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Payment Status Badges */
.payment-status-verified {
    color: #059669;
    font-weight: 600;
}

.payment-status-pending {
    color: #d97706;
    font-weight: 600;
}

.payment-status-failed {
    color: #dc2626;
    font-weight: 600;
}

/* Modal Enhancements */
.modal-backdrop {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Admin Tables */
@media (max-width: 768px) {
    .admin-table {
        font-size: 0.875rem;
    }
    
    .product-image-container {
        width: 40px;
        height: 40px;
    }
    
    .admin-stat-card {
        padding: 16px;
    }
    
    .admin-stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* ========================================
   iOS DEVICE OPTIMIZATIONS
   ======================================== */

/* Prevent iOS zoom on input focus */
input, select, textarea {
    font-size: 16px !important;
}

/* iOS Safe Area Support */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* iOS Touch Optimization */
button, a, input, select, textarea {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
}

/* Smooth Scrolling for iOS */
* {
    -webkit-overflow-scrolling: touch;
}

/* Fix iOS Button Styling */
button, input[type="submit"], input[type="button"] {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
}

/* iOS Input Field Fixes */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
}

/* Prevent iOS Text Size Adjustment */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* iOS Specific Media Queries */
@supports (-webkit-touch-callout: none) {
    /* iPhone X and newer notch support */
    header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
    
    footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .cart-sidebar {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* iOS Safari Specific Fixes */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    /* Retina display optimizations */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Fix iOS Modal Scrolling */
.modal-backdrop {
    position: fixed;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

/* iOS Button Active State */
button:active, a:active {
    opacity: 0.7;
    transition: opacity 0.1s;
}

/* Prevent iOS Rubber Band Effect on Body */
body {
    overscroll-behavior-y: none;
}

/* iOS Landscape Mode Fixes */
@media screen and (orientation: landscape) and (max-height: 500px) {
    header {
        padding: 10px 0;
    }
    
    .hero {
        padding: 40px 20px;
    }
}

/* iPhone SE and Small Devices */
@media screen and (max-width: 375px) {
    .container {
        padding: 0 12px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .product-card {
        padding: 12px;
    }
}

/* iPad and Tablet Optimizations */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* iOS Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if needed */
}


/* ========================================
   IPHONE SPECIFIC FIXES
   ======================================== */

/* Fix Home Section Below Header on iPhone */
.hero {
    margin-top: 0 !important;
    padding-top: 20px !important;
}

.page-content {
    margin-top: 0 !important;
}

/* Fix Body Padding for iPhone */
@supports (-webkit-touch-callout: none) {
    body {
        padding-top: max(80px, env(safe-area-inset-top)) !important;
    }
}

/* Fix Auth Modal Scrolling on iPhone */
.auth-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 9999 !important;
}

.auth-modal-box {
    margin: 20px auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.auth-form-section {
    max-height: none !important;
    overflow-y: visible !important;
}

/* iPhone Small Screen Modal Fix */
@media screen and (max-width: 414px) {
    .auth-modal-box {
        width: 95% !important;
        margin: 10px auto !important;
    }
    
    .auth-modal {
        padding: 10px !important;
    }
}


/* ========================================
   IPHONE PRODUCT MODAL IMAGE FIX
   ======================================== */

/* Fix Product Modal Image Size on iPhone */
.modal-content img,
.product-modal img,
.product-details-modal img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 250px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
}

/* iPhone Specific Product Modal */
@media screen and (max-width: 414px) {
    .modal-content img,
    .product-modal img,
    .product-details-modal img {
        min-height: 300px !important;
        max-height: 400px !important;
    }
    
    .modal-content,
    .product-modal,
    .product-details-modal {
        width: 95% !important;
        max-width: 95% !important;
    }
}

/* Product Image in Modal */
.product-modal-image,
.modal-product-image {
    width: 100% !important;
    height: auto !important;
    min-height: 300px !important;
    object-fit: cover !important;
}


/* ========================================
   CRITICAL IPHONE SIGNUP SCROLLING FIX
   ======================================== */

/* Force scrolling on auth modal backdrop */
.auth-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 9998 !important;
}

/* Remove height restrictions on iPhone */
@media screen and (max-width: 414px) {
    .auth-modal-box {
        min-height: auto !important;
        height: auto !important;
    }
    
    .auth-form {
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Add padding at bottom for button visibility */
    .auth-modal {
        padding-bottom: 100px !important;
    }
}

/* Ensure body doesn't block scrolling */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}
