@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f4f7f6;
    --primary: #10b981;
    --primary-hover: #059669;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(229, 231, 235, 0.5);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    transition: all 0.25s ease;
}

body {
    background: linear-gradient(135deg, #eefcf3 0%, #def7ec 50%, #f0fdf4 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(255,255,255,0) 70%);
    top: -50px;
    right: -50px;
    z-index: 0;
}

body::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(234, 179, 8, 0.1) 0%, rgba(255,255,255,0) 70%);
    bottom: -100px;
    left: -100px;
    z-index: 0;
}

/* Auth / Login specific styling */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    z-index: 10;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

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

.auth-logo {
    font-size: 3rem;
    margin-bottom: 8px;
    display: inline-block;
    animation: bounce 2s infinite ease-in-out;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-container {
    position: relative;
}

.input-container input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
}

.input-container input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.auth-btn {
    background: var(--primary);
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 14px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.auth-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Product Store Styles */
.store-container {
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.store-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-logo {
    font-size: 2.2rem;
}

.store-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-color);
}

.user-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
}

.search-container {
    display: flex;
    gap: 12px;
}

.search-input {
    flex-grow: 1;
    padding: 14px 20px;
    border: 1.5px solid var(--border-color);
    background: var(--white);
    border-radius: 14px;
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    box-shadow: var(--shadow);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.store-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .store-layout {
        grid-template-columns: 2.5fr 1fr;
    }
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(16, 185, 129, 0.3);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 14px;
    background-color: #f9fafb;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.card .category-badge {
    align-self: flex-start;
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: -4px;
}

.card .desc {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: -4px;
}

.card .pkr-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2px;
}


.card button {
    background: var(--white);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: 12px;
    padding: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.card button:hover {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.cart-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 14px;
}

#cart-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

#cart-items li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

#cart-items li div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    background: rgba(229, 231, 235, 0.6);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qty-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.remove {
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 6px;
}

#total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    border-top: 1.5px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
}

#checkout {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

#checkout:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ============================== 
   Checkout Page Specific Styles
   ============================== */

.checkout-body {
    display: block; /* Override flexbox from root body */
    min-height: 100vh;
    background: #ffffff;
}

.checkout-body::before, .checkout-body::after {
    display: none; /* Hide background gradients of main page */
}

.checkout-page {
    display: flex;
    flex-direction: column-reverse;
    min-height: 100vh;
    max-width: 1300px;
    margin: 0 auto;
}

@media (min-width: 1000px) {
    .checkout-page {
        flex-direction: row;
    }
}

/* Left Main Column */
.checkout-main {
    flex: 1;
    padding: 40px 20px;
    background: #ffffff;
}

@media (min-width: 1000px) {
    .checkout-main {
        padding: 50px 6% 50px 20px;
        border-right: 1px solid #e1e1e1;
    }
}

.checkout-header {
    margin-bottom: 20px;
}

.checkout-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.checkout-header .logo {
    font-size: 1.8rem;
}

.checkout-header .title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 35px;
    color: #707070;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb i {
    font-size: 0.7rem;
    margin: 0 6px;
    color: #bbb;
}

/* Form Elements */
.form-section {
    margin-bottom: 35px;
}

.form-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
}

.section-header h2 {
    margin-bottom: 0;
}

.section-header span {
    font-size: 0.85rem;
    color: #707070;
}

.section-header a {
    color: var(--primary);
    text-decoration: underline;
}

.subtext {
    color: #737373;
    font-size: 0.85rem;
    margin-top: -10px;
    margin-bottom: 15px;
}

.input-field {
    margin-bottom: 12px;
    width: 100%;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .input-row {
        grid-template-columns: 1fr;
    }
}

.checkout-page input[type="text"],
.checkout-page input[type="email"],
.checkout-page select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.checkout-page input:focus,
.checkout-page select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #4a4a4a;
    cursor: pointer;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Method Cards */
.method-card {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.method-card.selected {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.03);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.method-info {
    display: flex;
    flex-direction: column;
}

.method-name {
    font-weight: 500;
    color: #222;
    font-size: 0.95rem;
}

.method-time {
    font-size: 0.85rem;
    color: #737373;
}

.method-price {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Payment Panel */
.method-container {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    overflow: hidden;
}

.radio-check {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #222;
}

.radio-check input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.payment-info-panel {
    background: #f9f9f9;
    padding: 30px;
    text-align: center;
    border-top: 1px solid #d9d9d9;
    color: #555;
}

.payment-info-panel .icon {
    font-size: 2.5rem;
    color: #bbb;
    margin-bottom: 10px;
}

.payment-info-panel p {
    font-size: 0.9rem;
}

/* Footer and actions */
.form-actions {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
}

@media (max-width: 600px) {
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    .complete-order-btn {
        width: 100%;
    }
}

.complete-order-btn {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.complete-order-btn:hover {
    background: #333;
}

.back-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-footer {
    margin-top: 50px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.checkout-footer a {
    color: #737373;
    font-size: 0.75rem;
    text-decoration: none;
}

.checkout-footer a:hover {
    text-decoration: underline;
}

/* Sidebar Column (Right) */
.checkout-sidebar {
    flex: 0.8;
    background: #f5f5f5;
    padding: 40px 20px;
}

@media (min-width: 1000px) {
    .checkout-sidebar {
        padding: 50px 20px 50px 6%;
    }
}

.summary-content {
    max-width: 420px;
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 12px 10px 0; /* Add padding for overflowing badges */
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: relative;
}

.summary-item-img {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    flex-shrink: 0; /* CRITICAL: Prevents image being squished horizontally */
}

.summary-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.item-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #333; /* Darker for better contrast, matching reference */
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
}

.item-desc {
    font-size: 0.8rem;
    color: #737373;
}

.item-price {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.discount-code {
    display: flex;
    gap: 10px;
    padding: 20px 0;
    border-top: 1px solid #e1e1e1;
    border-bottom: 1px solid #e1e1e1;
    margin-bottom: 20px;
}

.discount-code input {
    flex: 1;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 0.9rem;
}

.discount-code button {
    background: #d9d9d9;
    color: #555;
    border: none;
    padding: 0 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.financials {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.line-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #535353;
}

.line-item span.free {
    font-size: 0.8rem;
    font-weight: 600;
    color: #222;
}

.total-row {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #e1e1e1;
    color: #333;
    align-items: center;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.total-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.total-value .currency {
    font-size: 0.75rem;
    color: #707070;
}

#checkout-total {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal-overlay.show .modal-content {
    animation: slideUp 0.4s forwards 0.1s;
}

.success-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #111;
}

.modal-content p {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

.order-num {
    background: #f3f4f6;
    padding: 8px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px !important;
}

#continueShopping {
    width: 100%;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
