:root {
    --primary: #ff9900;
    --light: #FFDDB5;
    --text: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.6;
}

header {
    background: var(--primary);
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
}

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.product-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
    width: 300px;
    /* 圖片最大寬高 */
    height: 300px;
    object-fit: contain;
    /* 萬一圖片比例不同也不會被裁切 */
    margin-inline: auto;
    /* 小螢幕自動置中 */
    display: block;
}

@media (min-width: 768px) {

    /* 大螢幕並排時，讓圖文都靠左，不留空隙 */
    .container {
        align-items: start;
    }
}

.info h2 {
    font-size: 2.5rem;
    margin-bottom: .5rem;
}

.badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: .8rem;
    padding: .2rem .6rem;
    border-radius: 4px;
    margin-right: .6rem;
}

.price {
    font-weight: 700;
    font-size: 1.5rem;
}

.description {
    margin-top: 1rem;
    font-size: .95rem;
    line-height: 1.8;
}

ul.spec {
    list-style: none;
    margin-top: 1.2rem;
}

ul.spec li {
    margin-bottom: .4rem;
}

/* actions */
.actions {
    margin-top: 4rem;
    display: flex;
    gap: 1rem;
}

.actions a {
    text-decoration: none;
    padding: .6rem 1.4rem;
    border-radius: 9999px;
    font-size: .9rem;
    transition: background .25s ease;
}

@media(max-width:480px) {
    .actions {
        margin-top: 2rem;
    }
}

.back {
    background: var(--light);
    color: var(--text);
}

.back:hover {
    background: #e0e0e0;
}

.notify {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
    border: none;
    padding: .6rem 1.4rem;
    border-radius: 9999px;
    cursor: pointer;
}

.notify:hover {
    background: #ff9900;
}

/* nutrition table */
table.nutri {
    width: 100%;
    border-collapse: collapse;
    margin-top: 3rem;
}

table.nutri th,
table.nutri td {
    border: 1px solid #000;
    padding: .4rem .6rem;
    font-size: .9rem;
    text-align: left;
}

table.nutri thead th {
    text-align: center;
}

.note {
    font-size: .8rem;
    margin-top: 1rem;
    border: 1px solid #000;
    padding: 1rem;
}

/* ====== Modal 彈窗 ====== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: none;
    /* 預設隱藏 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    width: clamp(280px, 90%, 420px);
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .1);
    position: relative;
}

.modal-content h3 {
    margin-bottom: .5rem;
}

.modal-content p {
    font-size: .9rem;
    margin-bottom: 1rem;
}

.modal-content input {
    width: 100%;
    padding: .6rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.modal-content button {
    padding: .6rem 1.6rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
}

.close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    font-size: 1.6rem;
    color: #888;
    font-weight: 700;
    cursor: pointer;
    transition: color .2s ease, transform .2s ease;
}

.close:hover {
    color: #000;
    transform: rotate(90deg);
}

/* ====== End ====== */

footer {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--light);
    font-size: 0.85rem;
}