body {
    margin: auto;
    padding: 50px;
    color: #000;
    font-family: 'Lato', sans-serif;
}

/* Box (for corners & padding) */
.box {
    padding-left: 20px;
    /* border-radius: 10px; */
    background-color: #ddd;
}


/* Set up grids... specifics */

/*  #### Grid for Main page #### */


.wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto;
    grid-template-areas: 
        "banner nav"
        "main main"
        "footer footer";
        grid-gap: 4px;
    
}

.banner {
    grid-area: banner;
}

.nav {
    grid-area: nav;
    background-color: #DDD;  /* silver */
    font-size: 150%;
    padding: 20px;
    vertical-align: middle;
    border: solid 1px;
}

.main {
    grid-area: main;
    background-color: #eee;  /* very pale grey */
    border: solid 1px #CCC;
}


.footer {
    grid-area: footer;
    text-align: right;
    padding: 20px;
}

/*  #### Grid for Navigation area page #### */

.linkwrapper {
    display: grid;
    grid-template-columns: 3fr 2fr 1fr;
    grid-template-areas: 
        "commonsearches topsearch topadmin";
    grid-gap: 4px;
}


.commonsearches {
    grid-area: commonsearches;
    text-align: center;
}

.topsearch {
    grid-area: topsearch;
    text-align: right;
}

.topadmin {
    grid-area: topadmin;
    text-align: center;
}

/* ### Additional div styling (put colours / corners here) */


/* Area colouring... */

/* logo, banner and footer background are the same */
.logo, .banner, .footer {
    background-color: #888;  /* dark grey */
}

/* Set font on dark areas to white */
.logo, .banner, .side, .footer {
    color: #fff;
}

/* #### Links Styling  #### */

/* Navigation Links */
a.topnav {font-weight: bold;}
a.topnav:link, a.topnav:visited {color: #007c72;} /*dark teal */
a.topnav:hover {color: #707a00; text-decoration: none;} 


/* links in page */
a {font-weight: bold;}
a:link{color: #007c72;} /* dark teal */
a:visited{color: #222;} /* dark grey */
a:hover{color: #707a00;}    /* Dark Green*/

/* #### Headings / text styling #### */
h1, h2, h3, h4 {
    font-family: 'Ubuntu', sans-serif;
}

.sub_heading {
    font-family: 'Ubuntu', sans-serif;
    color: #593849; /* purple */
    font-weight: bold;
}

/* ### Form / Search  Styling #### */

form {
    width: 100%;
}

.search {
    background:#fff;
    width: 75%;
}

.submit::-moz-focus-inner { 
    border: 0;
}


.submit {
    font-family: FontAwesome, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    position:relative;
    width: 45px;
    font-size: 14px;
    
    left:-5px;
    background-color: #636263; 
    color:#d6d3d7;
    border: 1px solid #000;
    border-radius: 0 5px 5px 0;   
    display: inline-block;
    padding: 10px;
}


input[type="submit"]:hover {
    background-color: #000;
}


input {
    font-size: 14px;
    padding: 10px;
    display: inline-block;
    border: 1px solid #000;
    box-sizing: border-box; 
}


.quicksearch {
    border-radius: 5px 0 0 5px;
    display: inline-block;
}

/* Below is custom edit for porsche */

* { box-sizing: border-box; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.banner-link {
    color: #fff;
    text-decoration: none;
}
.banner-link:hover { text-decoration: none; }
.tagline {
    font-weight: normal;
    font-size: 80%;
    margin-top: -8px;
}

.nav-toggle {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: 1px solid #fff;
    color: #fff;
    font-size: 20px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* #### Buttons #### */

.btn {
    display: inline-block;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 5px;
    border: 1px solid #000;
    background-color: #636263;
    color: #fff !important;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background-color: #000; color: #fff; text-decoration: none; }

.btn-primary { background-color: #007c72; border-color: #007c72; }
.btn-primary:hover { background-color: #005c54; }

.btn-danger { background-color: #a4262c; border-color: #a4262c; }
.btn-danger:hover { background-color: #7c1c21; }

.btn-small { padding: 4px 10px; font-size: 12px; }

/* #### Alerts / messages #### */

.alert {
    padding: 12px 16px;
    border-radius: 5px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-error {
    background-color: #fbe9e9;
    border-color: #a4262c;
    color: #7c1c21;
}
.alert-success {
    background-color: #e8f3e8;
    border-color: #2e7d32;
    color: #205722;
}
.alert ul { margin: 4px 0 0 20px; }

/* #### Badges (used for part / model category tags) #### */

.badge {
    display: inline-block;
    background-color: #007c72;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 9px;
    border-radius: 10px;
}

/* #### Card grid (models / parts listings) #### */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.card {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #ddd;
}

.card-body {
    padding: 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 105%;
}

.card-body .card-meta {
    font-size: 90%;
    color: #555;
    margin-bottom: 10px;
}

.card-body .card-price {
    font-weight: bold;
    color: #007c72;
    margin: 6px 0;
}

.card-body .btn { margin-top: auto; align-self: flex-start; }

/* #### Detail pages #### */

.detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

.detail-layout img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #ddd;
}

/* #### Forms (search / add / edit) #### */

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
    width: 100%;
    max-width: 480px;
}

.form-field .field-hint {
    display: block;
    font-size: 85%;
    color: #555;
    font-weight: normal;
}

.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.search-bar .form-field { margin-bottom: 0; }

/* #### Tables (admin listings) #### */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #636263;
    color: #fff;
}

.data-table tr:hover { background-color: #f4f4f4; }

.table-actions a { margin-right: 10px; }

.table-wrap {
    overflow-x: auto;
}

/* #### Home page hero + carousel #### */

.hero {
    background-color: #222;
    color: #fff;
    padding: 40px 30px;
    border-radius: 6px;
    margin-bottom: 24px;
}
.hero h2 { margin-top: 0; }
.hero .btn { margin-top: 10px; }

.carousel {
    position: relative;
    max-width: 700px;
    margin: 24px auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}

.carousel-track { position: relative; height: 260px; }

.carousel-slide {
    display: none;
    padding: 20px;
    height: 100%;
    box-sizing: border-box;
}
.carousel-slide.active { display: flex; flex-direction: column; justify-content: center; }
.carousel-slide h3 { margin: 0 0 8px 0; }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 16px;
}
.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

.carousel-dots {
    text-align: center;
    padding: 10px 0;
}
.carousel-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #636263;
    background-color: #fff;
    margin: 0 4px;
    padding: 0;
    cursor: pointer;
}
.carousel-dots button.active { background-color: #636263; }

/* #### Responsive breakpoint #### */

@media (max-width: 760px) {

    body { padding: 12px; }

    .wrapper {
        grid-template-columns: 1fr;
        grid-template-areas:
            "banner"
            "nav"
            "main"
            "footer";
    }

    .box.banner { position: relative; padding: 20px; }
    .nav-toggle { display: block; }

    .box.nav#siteNav { display: none; }
    .box.nav#siteNav.open { display: block; }

    .linkwrapper {
        grid-template-columns: 1fr;
        grid-template-areas:
            "commonsearches"
            "topsearch"
            "topadmin";
        text-align: center;
    }

    .commonsearches, .topsearch, .topadmin { text-align: center; }

    .detail-layout { grid-template-columns: 1fr; }

    .search-bar { flex-direction: column; align-items: stretch; }
}

/* 1. Make the form align items in a single horizontal row */
.topsearch form {
    display: flex;
    align-items: stretch;
}

/* 2. Style the autocomplete wrapper to fill remaining space */
.topsearch .autocomplete {
    position: relative;
    flex: 1;
}

/* 3. Remove right border radius from the input field */
.topsearch input.search {
    width: 100%;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none; /* Prevents a double border where they join */
}

/* 4. Remove left border radius from the submit button */
.topsearch input.submit {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    cursor: pointer;
}
