/* tienda.css */
body {
    background-color: #ffffff;
    color: #333;
}

/* HEADER */
.store-header {
    background-color: #3498db;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo h1 {
    margin: 0;
    font-size: 24px;
    font-family: 'Outfit', sans-serif;
    color: #ffffff;
}

.cart-icon {
    font-size: 24px;
    cursor: pointer;
    position: relative;
    padding: 5px;
}

/* User & Cart Icons in Header */
.header-actions i {
    color: white !important;
}

.header-actions span {
    color: white !important;
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #e74c3c;
    color: white !important;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* HERO */
.hero {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.hero h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

/* PRODUCT GRID */
.product-grid {
    display: grid;
    /* Adjusted from 220px to allow 4 columns on standard screens */
    /* 1200px container / 4 = 300px minus gaps. */
    /* Using minmax(200px, 1fr) should allow 4 items even on smaller laptops */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Softer but larger shadow */
    border: 1px solid #e0e0e0;
    /* Distinct border */
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    /* Hand cursor */
    position: relative;
    height: 400px;
    /* Slightly taller */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
    /* Highlight border on hover */
}

.product-img-container {
    height: 220px;
    /* Taller image area */
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    border-bottom: 4px solid #3498db;
    /* The requested separator line */
}

/* Slight zoom on hover */
.product-card:hover .product-img-container {
    transform: scale(1.02);
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: auto;

    /* Hidden by default */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* Show buttons on hover */
.product-card:hover .btn-group {
    opacity: 1;
    transform: translateY(0);
}

.search-container {
    flex: 1;
    margin: 0 40px;
    max-width: 700px;
    /* Wider */
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 15px 25px;
    /* Larger padding */
    border: 2px solid #eee;
    /* Thicker border */
    border-radius: 30px;
    /* More rounded */
    outline: none;
    font-size: 18px;
    /* Larger text */
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
}

.search-container input:focus {
    border-color: #3498db;
    background: #fff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    /* Stronger shadow on focus */
}

/* Search Icon placeholder using ::after is tricky with input, 
   so we keep it simple or use a background image */
.search-container input::placeholder {
    color: #95a5a6;
    font-weight: 500;
}

.btn-view {
    flex: 1;
    background: #34495e;
    border: none;
    color: white;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-view:hover {
    background: #2c3e50;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 10px;
}

.btn-add {
    margin-top: auto;
    background: #3498db;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    width: 100%;
}

.btn-add:hover {
    background: #2980b9;
}

.out-of-stock {
    background: #95a5a6;
    cursor: not-allowed;
}

/* CART DRAWER /* CART MODAL REDESIGN */
.cart-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: flex-end;
    z-index: 1000;
}

.cart-drawer {
    background: white;
    width: 450px;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.cart-header {
    background: #3498db;
    /* Header Blue */
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-cart {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
}

.close-cart:hover {
    opacity: 1;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 6px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.free-shipping-tag {
    display: inline-block;
    background: #3498db;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-weight: bold;
}

.cart-item-price {
    font-weight: bold;
    color: #3498db;
    font-size: 16px;
    margin-top: 5px;
}

.qty-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    /* Pill shape */
    padding: 2px 5px;
    margin-top: 8px;
}

.btn-qty {
    background: none;
    border: none;
    color: #3498db;
    font-weight: bold;
    width: 30px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
}

.qty-val {
    padding: 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.btn-delete {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    align-self: flex-start;
}

.btn-delete:hover {
    color: #e74c3c;
}

.cart-footer {
    padding: 20px;
    background: #fdfdfd;
    border-top: 1px solid #eee;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.summary-row.total {
    font-size: 24px;
    font-weight: 800;
    color: #3498db;
    margin-top: 10px;
    margin-bottom: 15px;
}

.checkout-form {
    margin-top: 15px;
}

.checkout-form h4 {
    margin-bottom: 15px;
    font-size: 15px;
    color: #333;
    font-weight: 700;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row input {
    width: 100%;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    color: #555;
    outline: none;
    transition: border 0.3s;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    border-color: #3498db;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 30px;
    /* Round button */
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
    transition: background 0.3s;
}

.btn-checkout:hover {
    background: #2980b9;
}

.total-row {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* FREE SHIPPING BADGE */
.free-shipping-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #3498db;
    /* Blue color */
    color: white;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
}

.product-card {
    position: relative;
    /* Ensure badge is positioned relative to card */
}

/* ADDED TO CART TOAST */
#added-toast {
    position: fixed;
    top: 80px;
    /* Below header */
    right: 20px;
    background: white;
    width: 320px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
    border: 1px solid #eee;
}

#added-toast .toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

#added-toast .toast-title {
    font-weight: bold;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 5px;
}

#added-toast .toast-body {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

#added-toast .toast-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 4px;
}

#added-toast .toast-info {
    flex: 1;
}

#added-toast .toast-name {
    font-size: 13px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#added-toast .toast-price {
    font-weight: bold;
    color: #2c3e50;
}

#added-toast .btn-view-cart {
    display: block;
    width: 100%;
    background: #3498db;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
    border: 1px solid #3498db;
}

#added-toast .btn-view-cart:hover {
    background: #2980b9;
}

/* CHECKOUT MODAL STYLES */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.checkout-container {
    background: white;
    width: 600px;
    max-width: 95%;
    max-height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.checkout-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: center;
    position: relative;
    background: #fff;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #999;
}

.step-icon {
    width: 30px;
    height: 30px;
    border: 2px solid #ccc;
    /* Default grey */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

.step.active .step-icon {
    border-color: #333;
    color: #333;
    font-weight: bold;
}

.step.active span {
    color: #333;
    font-weight: 600;
}

.step.completed .step-icon {
    background: #4caf50;
    /* Green check */
    border-color: #4caf50;
    color: white;
}

.step.completed span {
    color: #4caf50;
}


.step-line {
    width: 40px;
    height: 2px;
    background: #eee;
    margin-top: -15px;
    /* Alignment with circle */
}

.step-line.active {
    background: #333;
}


/* Body & Form */
.checkout-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.checkout-body h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #000;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: border 0.3s;
}

.form-input:focus,
.form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-group-check {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.input-group-check label {
    font-size: 12px;
    margin-top: -10px;
    margin-bottom: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Footer */
.checkout-footer {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    background: #fafafa;
    text-align: right;
}

.btn-continue {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.btn-continue:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FOOTER */
.store-footer {
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 40px 20px;
    margin-top: 50px;
    border-top: 1px solid #dcdcdc;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-column {
    flex: 1;
    min-width: 250px;
}

.footer-column h3 {
    color: #3498db;
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
    padding-bottom: 5px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    text-decoration: none;
    color: #3498db;
    /* Blue text */
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #2980b9;
}

.contact-info p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #3498db;
    /* Blue text */
}

.contact-info a {
    color: #3498db;
    /* Blue text for links */
}

.contact-icon {
    color: #3498db;
    font-size: 18px;
    width: 20px;
    /* Fixed width for alignment */
    text-align: center;
}

@media (max-width: 768px) {
    .store-header {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .search-container {
        margin: 0;
        width: 100%;
        max-width: 100%;
    }

    .search-container input {
        padding: 10px 20px;
        font-size: 16px;
    }

    .hero {
        padding: 40px 15px;
    }

    .hero h2 {
        font-size: 24px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .product-card {
        height: auto;
        /* Allow content to flow */
        min-height: 320px;
    }

    .product-img-container {
        height: 150px;
    }

    .product-title {
        font-size: 14px;
    }

    .product-price {
        font-size: 16px;
    }

    .cart-drawer {
        width: 100%;
    }

    .checkout-container {
        width: 95%;
        max-height: 95vh;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-column h3 {
        margin-bottom: 10px;
    }

    .contact-info p {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
        /* Single column on very small screens */
    }

    .btn-checkout {
        padding: 12px;
        font-size: 14px;
    }
}