/* FILE: pages.css */

/* --- TIKTOK SEARCH OVERRIDE --- */
.hero-search-override {
    background: var(--light-bg); 
    padding: 60px 20px;
    text-align: center;
    border-bottom: 5px solid var(--secondary-color);
}

.search-headline {
    font-size: 3rem; 
    color: var(--primary-color);
    margin-bottom: 10px;
    /* Enforce size on desktop and mobile */
    font-weight: 800; 
}
.search-subtext {
    font-size: 1.2rem;
    color: var(--dark-text);
    margin-bottom: 30px;
}

.large-search-container {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 500px;
}

.main-item-search-form {
    display: flex;
    width: 100%;
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    border-radius: 12px;
    overflow: hidden;
}

.large-search-input {
    flex-grow: 1;
    padding: 18px 25px; /* Large padding for height */
    border: none;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark-text);
}
.large-search-input::placeholder {
    color: #999;
}

.large-search-button {
    flex-shrink: 0;
    width: 120px; /* Give it a decent size */
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.large-search-button:hover {
    background: #004482;
}

.browse-link-override {
    display: block;
    margin-top: 25px;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}
.browse-link-override:hover {
    text-decoration: underline;
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 600px) {
    .search-headline {
        font-size: 2.2rem;
    }
    .large-search-input {
        padding: 15px 15px; 
        font-size: 1rem;
    }
    .large-search-button {
        width: 80px;
        font-size: 1rem;
    }
}

/* --- HOMEPAGE LAYOUT --- */
.hero {
    background: var(--primary-color);
    color: var(--light-text);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    color: var(--light-text);
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.features {
    padding: 60px 0;
    background: #fff;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.placeholder-img {
    width: 100%;
    height: 200px;
    background-color: #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #777;
    margin-bottom: 20px;
}

.cta-banner {
    background: var(--dark-text);
    color: var(--light-text);
    padding: 60px 0;
    text-align: center;
}

/* --- PRODUCT PAGE LAYOUT --- */
.product-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 30px;
}

.product-gallery {
    flex: 1 1 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gallery-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.gallery-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: border-color 0.2s;
}
.product-info {
    flex: 1 1 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.product-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    margin: 0;
}
.product-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: #B12704;
}
.product-stock-status {
    font-size: 0.9rem;
    color: #007600;
    font-weight: 500;
}
.seller-info {
    font-size: 0.9rem;
    color: #555;
}
.seller-info a {
    color: #0066c0;
    text-decoration: none;
}
.product-actions-box {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-top: 10px;
}
.product-actions-box input[type="number"] {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
    width: 60px;
}
.product-description-section {
    margin-top: 20px;
}
.product-description-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.product-description-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}
.utility-bar {
    font-size: 0.9rem;
    color: #777;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px dashed #ccc;
}


/* --- CART PAGE LAYOUT (The new two-column system) --- */
.cart-layout-grid {
    /* Desktop/Tablet View (Side-by-Side) */
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: flex-start;
    padding: 20px 0;
}

.cart-items-wrapper {
    min-width: 0;
}

.checkout-summary-frame {
    background: var(--light-bg);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    position: sticky;
    top: 100px;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 500;
}

.total-row {
    padding-top: 15px;
    border-top: 1px solid #ccc;
    margin-top: 10px;
    font-weight: 700;
}

.checkout-actions {
    text-align: center;
}

.checkout-actions form {
    display: block;
    width: 100%;
    margin: 0;
}

.checkout-actions form input[type="image"] {
    max-width: 200px;
    height: auto;
}

/* --- CART ITEM SPECIFIC FIXES (Issues #2 & #3) --- */
.cart-item-row {
    align-items: center; 
}

.cart-item-row .product-list-info {
    flex-grow: 1;
    flex-basis: 200px;
    gap: 0;
    margin-right: 15px;
}

.cart-item-price-unit, .cart-item-price-total {
    font-size: 0.95rem;
    color: #555;
    margin-top: 5px;
}

.cart-item-price-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-text);
}


.cart-actions-column {
    flex-shrink: 0; 
    width: 120px; 
}

.cart-update-form {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.quantity-control-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-qty-input {
    width: 45px !important;
    padding: 6px;
    text-align: center;
    height: 34px;
    font-size: 0.9rem !important;
}

.btn-update, .btn-remove {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    height: 34px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-update {
    background: var(--secondary-color);
}
.btn-update:hover {
    background: #008a68;
}

.btn-remove {
    background: #B12704;
}
.btn-remove:hover {
    background: #721c24;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}


/* --- MESSENGER LAYOUT --- */
.messenger-layout {
    display: flex;
    border: 1-px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    height: 70vh;
    min-height: 500px;
    background: #fff;
    font-size: 0.95rem;
    text-align: left;
}

.conversation-list {
    flex: 0 0 300px;
    border-right: 1px solid #ddd;
    background: #fcfcfc;
    display: flex;
    flex-direction: column;
}

.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}


/* --- WIZARD LAYOUT --- */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin: 20px auto 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
}
.wizard-progress-step {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    border-bottom: 4px solid #e0e0e0;
    color: #999;
    font-weight: 600;
}


/* --- MEDIA QUERIES (Pages) --- */
@media (max-width: 768px) {
    /* Homepage and General Layout adjustments */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid:nth-child(even) .feature-item:first-child { order: 2; }
    .features-grid:nth-child(even) .feature-item:last-child { order: 1; }

    .hero-cta-group {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Product Page adjustments */
    .product-container {
        padding: 20px;
        gap: 30px;
    }
    .product-title {
        font-size: 1.5rem;
    }
    .product-price {
        font-size: 1.75rem;
    }
}

@media (max-width: 992px) {
    /* Cart Layout adjustments (Issue #2 fix) */
    .cart-layout-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .cart-items-wrapper { order: 2; }
    .checkout-summary-frame { order: 1; position: relative; }

    /* Fix cart item display in stacked mobile view */
    .cart-item-row {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .product-list-image {
        width: 60px;
        height: 60px;
    }
    
    .product-list-image img {
        width: 60px;
        height: 60px;
    }

    .product-list-info {
        flex-basis: auto; 
        flex-grow: 1;
        margin-right: 0;
        min-width: 200px;
    }
    
    .cart-actions-column {
        order: 3;
        width: 100%;
        margin-top: 10px;
        border-top: 1px dashed #eee;
        padding-top: 10px;
    }
    
    .cart-update-form {
        align-items: flex-start; /* Aligns controls to the left */
    }
    
    .quantity-control-group {
        width: auto;
    }
}