* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: repeat(12, 1fr);
}

header {
    grid-row: 1;
    grid-column: 1 / 13;;
    margin-bottom: 2rem;
}

footer {
    grid-row: auto;
    grid-column: 1 / 13;
    margin-top: 2rem;
}

header, footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header img {
    height: 4rem;
}

nav {
    grid-row: 2;
    grid-column: 1 / 3;
    display: flex;
    align-items: center;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

nav ul {
    list-style: none;
    gap: 1rem;
}

nav ul li {
    cursor: pointer;
}

 nav ul li a {
    text-decoration: none;
}

/*-------------------- Home -------------------*/
main {
    grid-row: 2;
    grid-column: 1 / 13;
    display: flex;
    flex-wrap: wrap;
    margin: 1rem;
}

.product-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    width: calc(25% - 6rem/4);
    padding: 1rem;
}

.product-card:hover {
    transform: scale(1.05);
}

.product-card img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/*-------------------- Show Product -------------------*/
.product-preview {
    grid-row: 2;
    grid-column: 1 / 13;
    display: grid;
    grid-auto-rows: 1fr;
    grid-template-columns: repeat(6, 1fr);
    margin-top: 1rem;
    margin-bottom: 1rem;
    margin-left: 5rem;
    margin-right: 5rem;
}

.product-title {
    grid-row: 1;
    grid-column: 1 / 7;
    margin-bottom: 1rem;
    text-align: center;
}

.product-main-mockup {
    grid-row: 2 / 11;
    grid-column: 1 / 5;
}

.product-main-mockup img {
    width: 35rem;
    border-radius: 0.5rem;
}

.product-price {
    grid-row: 2;
    grid-column: 4 / 7;
    height: auto;
}

.product-all-mockups {
    grid-row: 3;
    grid-column: 4 / 7;
    gap: 1rem;
}

.product-all-mockups img {
    width: 4rem;
    height: auto;
    border-radius: 0.5rem;
}

.product-sizes {
    grid-row: 4;
    grid-column: 4 / 7;
    gap: 1rem;
}

.button-add-to-cart {
    grid-row: 5;
    grid-column: 4 / 7;
    padding: 0.75rem 1.5rem;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: center;
    align-content: center;
    width: 12rem;
    height: 3rem;
}

.description {
    grid-row: 11 / 17;
    grid-column: 1 / 13;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

/*-------------------- Cart Badge -------------------*/
.cart-icon-wrapper {
    position: relative;
    display: inline-flex;
}

.cart-icon-wrapper a {
    position: relative;
    display: inline-flex;
}

.cart-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.4rem;
    background-color: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 1.2rem;
    height: 1.2rem;
    font-size: 0.7rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/*-------------------- Cart Page -------------------*/
.cart-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.cart-heading {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    margin-bottom: 1rem;
}

.cart-item img {
    width: 6rem;
    height: auto;
    border-radius: 0.5rem;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h3 {
    margin-bottom: 0.25rem;
}

.cart-item-price {
    font-weight: bold;
    margin-top: 0.25rem;
}

.remove-item-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    flex-shrink: 0;
}

.remove-item-btn:hover {
    background-color: #fee;
    border-color: #e74c3c;
    color: #e74c3c;
}

.cart-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.cart-total-row {
    display: flex;
    gap: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.button-checkout {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    text-align: center;
}

.button-checkout:hover {
    background-color: #555;
}

.cart-empty {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.cart-empty a {
    color: #333;
    text-decoration: underline;
}

/*-------------------- Checkout Page -------------------*/
.checkout-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    padding: 1.5rem;
    align-items: start;
}

.checkout-form-section {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.checkout-form-section h2 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.checkout-form-section h2:first-of-type {
    margin-top: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 0.35rem;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.4rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #333;
}

.payment-note {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #555;
}

.stripe-card-element {
    padding: 0.65rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.4rem;
    background-color: #fff;
    transition: border-color 0.2s;
}

.stripe-card-element.StripeElement--focus {
    border-color: #333;
}

.card-errors {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.4rem;
    min-height: 1.2rem;
}

.button-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: inherit;
    margin-top: 1.5rem;
    transition: background-color 0.2s;
}

.button-pay:hover:not(:disabled) {
    background-color: #555;
}

.button-pay:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.checkout-summary {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    position: sticky;
    top: 1rem;
}

.checkout-summary h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.checkout-item img {
    width: 4rem;
    height: auto;
    border-radius: 0.4rem;
    object-fit: cover;
}

.checkout-item div {
    flex: 1;
}

.checkout-item p {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.checkout-item-price {
    font-weight: bold;
    white-space: nowrap;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.checkout-success {
    text-align: center;
    padding: 2rem;
}

.checkout-success h2 {
    font-size: 1.5rem;
    color: #27ae60;
    margin-bottom: 1rem;
}

.checkout-success p {
    color: #555;
    margin-bottom: 1.5rem;
}