
html, body {
    height: 100%;
}
body {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    font-family: Ubuntu , sans-serif;
    grid-template-rows: min-content;
    background-color: #f8f9fa;
    >.availavility-bound{
        background-color: deeppink;
        text-align: center;
        grid-column: 1/4;
    }
    > .header-main {
        grid-column: 1/4;
        background-color: #ffffff;
        border-bottom: 1px solid #dfe1e5;
        padding: 10px 0;
        max-width: 100vw;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        .header-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            .logo a {
                font-size: 24px;
                font-weight: bold;
                color: #4285f4;
                text-decoration: none;
                letter-spacing: -1px;
            }

            .nav-links {
                display: flex;
                gap: 20px;

                a {
                    text-decoration: none;
                    color: #3c4043;
                    font-size: 16px;
                    transition: color 0.2s;

                    &:hover {
                        color: #4285f4;
                    }
                }
            }

            .user-actions {
                display: flex;
                align-items: center;
                gap: 20px;

                .action-link {
                    text-decoration: none;
                    color: #3c4043;
                    font-weight: 500;
                }

                .cart-icon {
                    position: relative;
                    color: #5f6368;
                    display: flex;
                    align-items: center;
                    text-decoration: none;

                    .cart-count {
                        position: absolute;
                        top: -8px;
                        right: -10px;
                        background-color: #ea4335;
                        color: white;
                        font-size: 11px;
                        padding: 2px 6px;
                        border-radius: 50%;
                        font-weight: bold;
                    }
                }
            }
        }
    }
    > .container{
        grid-column: 2/3;
        display: flex;
        width: 90vw;
        max-width: 1200px;
        margin: 0 auto;
        flex-direction: column;
        min-height: 50vh;
        height: min-content;
        > .main-title {
            text-align: center;
            font-size: 80px;
            margin: 20px 0;
        }
        > h2{
            text-align: center;
            font-size: 25px;
            margin: 20px 0;
        }
        .search-container{
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 20px;
            margin-bottom: 40px;
            text-align: center;
            flex-grow: 1;
            >form{
                width: 100%;
                .search-box {
                    position: relative;
                    max-width: 584px;
                    margin: 0 auto;
                    display: flex;
                    align-items: center;
                    border: 1px solid #dfe1e5;
                    border-radius: 24px;
                    padding: 5px 15px;
                    transition: box-shadow 0.2s;
                    background-color: #fff;

                    &:hover, &:focus-within {
                        box-shadow: 0 1px 6px rgba(32,33,36,0.28);
                        border-color: rgba(223,225,229,0);
                    }

                    .search-icon {
                        color: #9aa0a6;
                        padding-right: 13px;
                        display: flex;
                        align-items: center;
                        background: none;
                        border: none;
                        cursor: pointer;
                        padding: 0;
                    }

                    .search-input {
                        flex-grow: 1;
                        border: none;
                        outline: none;
                        height: 34px;
                        font-size: 16px;
                        color: #202124;
                        background-color: transparent;
                        padding-left: 10px;
                    }
                }
            }
        }

    }
    > .footer-main {
        background-color: #3c4043;
        color: #ffffff;
        padding: 10px 0 20px;
        margin-top: auto;
        width: 100%;
        grid-column: 1/4;
        .footer-container {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 40px;
            padding: 0 20px;

            .footer-section {
                display: flex;
                flex-direction: column;

                .footer-title {
                    font-size: 18px;
                    font-weight: bold;
                    margin-bottom: 20px;
                    color: #ffffff;
                }

                .footer-description {
                    font-size: 14px;
                    line-height: 1.6;
                    color: #dfe1e5;
                }

                .footer-links, .footer-contact {
                    list-style: none;
                    padding: 0;
                    margin: 0;

                    li {
                        margin-bottom: 12px;
                        font-size: 14px;

                        a {
                            color: #dfe1e5;
                            text-decoration: none;
                            transition: color 0.2s;

                            &:hover {
                                color: #ffffff;
                            }
                        }
                    }
                }

                .footer-contact li {
                    color: #dfe1e5;
                }
            }
        }

        .footer-bottom {
            max-width: 1200px;
            margin: 40px auto 0;
            padding: 20px 20px 0;
            border-top: 1px solid #5f6368;
            text-align: center;
            font-size: 14px;
            color: #9aa0a6;
        }
    }

    .error-page {
        padding: 60px 20px;
        text-align: center;
        .error-content {
            max-width: 600px;
            margin: 0 auto;
            .error-title {
                font-size: 48px;
                color: #202124;
                margin-bottom: 20px;
            }
            .error-message {
                font-size: 18px;
                color: #5f6368;
                margin-bottom: 30px;
            }
            .error-actions {
                display: flex;
                justify-content: center;
                gap: 15px;
                .btn {
                    padding: 10px 24px;
                    border-radius: 4px;
                    font-size: 16px;
                    font-weight: 500;
                    cursor: pointer;
                    transition: all 0.2s;
                    &.btn-primary {
                        background-color: #4285f4;
                        color: white;
                        &:hover {
                            background-color: #1a73e8;
                            box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15);
                        }
                    }
                    &.btn-secondary {
                        background-color: #f8f9fa;
                        color: #3c4043;
                        border: 1px solid #dadce0;
                        &:hover {
                            background-color: #f1f3f4;
                            border-color: #d2d4d7;
                        }
                    }
                }
            }
        }
    }
    a{
        text-decoration: none;
        color: inherit;
    }
}



/* Container */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
    > .pagination{
        display: grid;
        grid-auto-flow: column;
        grid-template-columns: auto repeat(3, 1fr) auto;
    }
    .dashboard-grid {
        display: grid;
        grid-template-columns: 7fr 3fr;
        width: 100%;
        gap: 30px;
        #goodFormContainer{
            form{
                max-height: 80vh;
                overflow-y: scroll;
                > .form-actions{
                    display: grid;
                    grid-template-columns: repeat(auto-fill,minmax(100px,1fr));
                    grid-template-rows: 1fr;
                    gap: 10px;
                    > button{
                        justify-self: center;
                    }
                }
            }

        }
        section {
            background: #fff;
            border: 1px solid #dfe1e5;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            h2 { margin-top: 0; }

            table.table {
                width: 100%;
                border-collapse: collapse;

                thead {
                    background: #f8f9fa;
                }

                th, td {
                    padding: 10px 12px;
                    border-bottom: 1px solid #e9ecef;
                    text-align: left;
                }

                tr:hover { background: #fafafa; }

                button {
                    margin-right: 10px;
                }
            }

            form {
                display: grid;
                grid-template-columns: 1fr;
                gap: 10px;

                textarea {
                    resize: vertical;
                    min-height: 100px;
                }

                > div {
                    display: grid;
                    gap: 6px;
                }

                button[type="submit"] {
                    justify-self: start;
                }

                .image-preview {
                    margin-top: 10px;
                    img {
                        max-width: 100%;
                        max-height: 200px;
                        border-radius: 4px;
                        border: 1px solid #dfe1e5;
                    }
                }
            }

            &:last-child {
                position: sticky;
                top: 20px;
                align-self: start;
            }
        }
    }
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;

    &.btn-primary {
        background-color: #4285f4;
        color: white;

        &:hover {
            background-color: #357ae8;
        }
    }

    &.btn-secondary {
        background-color: #f8f9fa;
        border: 1px solid #dadce0;
        color: #3c4043;

        &:hover {
            background-color: #f1f3f4;
        }
    }

    &.btn-block {
        display: block;
        width: 100%;
    }

    &.btn-small {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Forms */
.form-group {
    margin-bottom: 15px;

    label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
        color: #3c4043;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    textarea {
        width: 100%;
        padding: 10px;
        border: 1px solid #dfe1e5;
        border-radius: 4px;
        box-sizing: border-box;
    }

    &.form-group-checkbox, &.form-group-radio {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
    }
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);

    .product-image img {
        width: 100%;
        height: auto;
        border-radius: 4px;
    }

    .product-info {
        h1 {
            margin-top: 0;
            color: #202124;
        }
        > .description{
            > p{
                 line-height: 1.5;
             }
        }
        .reference {
            color: #70757a;
            font-size: 14px;
        }

        .price-tag {
            margin: 20px 0;

            .price {
                font-size: 28px;
                font-weight: bold;
                color: #ea4335;
            }
        }

        .product-meta {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 4px;
            margin: 20px 0;

            p {
                margin: 5px 0;
                font-size: 14px;
            }
        }
    }
}

/* Search Results / Grid */
.search-header {
    margin-bottom: 20px;
}

.product-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin: 0 auto;

    > .product-card {
        width: 300px;
        background: white;
        border: 1px solid #dfe1e5;
        border-radius: 8px;
        overflow: hidden;
        transition: transform 0.2s, box-shadow 0.2s;
        display: flex;
        flex-direction: column;

        &:hover {
            transform: translateY(-5px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        a {
            text-decoration: none;
            color: inherit;
            flex-grow: 1;
        }

        .card-image img {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }

        .card-content {
            padding: 15px;

            h3 {
                margin: 0 0 10px;
                font-size: 18px;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .card-reference, .card-manufacturer {
                font-size: 12px;
                color: #70757a;
                margin: 2px 0;
            }

            .card-price {
                font-weight: bold;
                color: #ea4335;
                font-size: 18px;
            }
        }

        .card-actions {
            padding: 10px 15px 15px;
            text-align: center;
        }
    }
}


/* Checkout */
.checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;

    .checkout-form, .order-summary {
        background: white;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .summary-item {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;

        >span:last-child {
            width: 80px;
        }

        &.total {
            border-top: 1px solid #dfe1e5;
            padding-top: 15px;
            margin-top: 15px;
            font-weight: bold;
            font-size: 20px;
        }
    }
}

.text-muted {
    color: #6c757d;
}

/* Profile */
.profile-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;

    .profile-sidebar {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        align-self: start;

        .user-info-brief {
            text-align: center;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #dfe1e5;

            .profile-img {
                width: 100px;
                height: 100px;
                border-radius: 50%;
                object-fit: cover;
                margin-bottom: 10px;
            }
        }

        .profile-nav a {
            display: block;
            padding: 10px;
            text-decoration: none;
            color: #3c4043;
            border-radius: 4px;

            &:hover, &.active {
                background-color: #f1f3f4;
                color: #4285f4;
            }
        }
    }

    .profile-content {
        background: white;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);

        .profile-section {
            margin-bottom: 40px;
        }
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;

    th, td {
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #dfe1e5;
    }

    .status-badge {
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: bold;
        text-transform: uppercase;

        &.PENDING { background: #fef7e0; color: #f29900; }
        &.SHIPPED { background: #e8f0fe; color: #1967d2; }
        &.DELIVERED { background: #e6f4ea; color: #137333; }
        &.CANCELLED { background: #fce8e6; color: #c5221f; }
    }
}

@media (max-width: 768px) {
    .product-detail, .auth-wrapper, .checkout-container, .profile-container {
        grid-template-columns: 1fr;
    }
}