/* --- Product Grid (shop.php) --- */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.product-item {
    width: 32%;
    margin-bottom: 2em;
    border: 1px solid #ddd;
    padding: 1em;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.product-item img {
    width: auto;
    height: 250px;
    object-fit: contain;
    margin: 0 auto 1em;
}

.product-item h3 {
    font-size: 1.6rem;
    margin-bottom: 0.5em;
    line-height: 1.6em;
}

.product-item .price {
    font-weight: bold;
    color: #e84346;
    margin-bottom: 0.5em;
    font-size: 1.8rem;
}

.product-item .description {
    font-size: 1.4rem;
    color: #666;
    flex-grow: 1;
    margin-bottom: 1em;
    text-align: left;
}

.add-to-cart-btn {
    background-color: #eb6f8c;
    color: white;
    border: none;
    padding: 0.8em 1em;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.4rem;
    width: 100%;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #d65a79;
}

/* @media screen and (max-width: 979px) {
    .product-item {
        width: 48%;
    }
} */

@media screen and (max-width: 767.98px) {
    .product-grid:nth-of-type(2) li:last-child{
        margin-right: 49%;
    }
    .product-item {
        width: 49%;
    }
    .product-item img {
    width: 100%;
    height: auto;
}

}

.mobile-linebreak {
    display: inline; /* Default to inline for larger screens */
}

@media screen and (max-width: 767.98px) {
    .mobile-linebreak {
        display: block; /* Force line break on mobile */
    }
}

/* --- Cart & Checkout Tables --- */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th,
.cart-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.cart-table th {
    background-color: #f2f2f2;
}

.cart-table img {
    width: 100px;
    height: auto;
}

.cart-actions {
    text-align: right;
    margin-bottom: 20px;
}

.total-price {
    text-align: right;
    font-size: 1.2em;
    font-weight: bold;
}

/* --- Checkout Form --- */
.checkout-form {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.checkout-form div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
        margin-bottom: 1em;
}

.checkout-form div label {
    display: block;
    font-weight: bold;
    width: 30%;
}

.checkout-form div label span {
    color: red;
    font-weight: normal;
    font-size: 0.8em;
    padding-left: 1em;
}

.checkout-form div input{
    width: 40%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.checkout-form div.long input ,
textarea{
    width: 70% !important;
}

.checkout-form div input[type="radio"] {
    width: auto;
    margin-right: 10px;
}

div.pay ul{
margin: 0;
width: 70%;
}

.checkout-form div.pay ul li {
    display: flex;
    margin-bottom: 0.5em;
}
.checkout-form div.pay ul li label{
    width: fit-content;
}

.order-summary {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.button-area {
    justify-content: center;
}
.button-area a,
.button-area button{
margin: 0 1em;
}

.button-area .bar {
    color: #fff;
    background: #ddd;
    border-radius: 0.4rem;
    padding: 0.3rem 1rem;
    text-align: center;
    margin-top: 2em;
    margin-bottom: 0 !important;
    font-size: 1.3em;
    border: none;
    cursor: pointer;
    height: 2em;
}

.category a.bar:hover,
.button-area .bar:hover {
    background: orange;
}

.button-area .bar.confirm-order:not(:disabled) {
    background-color: red; /* 有効な状態の背景色 */
    cursor: pointer;
}

.button-area .bar.confirm-order:disabled {
    background-color: #ddd; /* 無効な状態の背景色 */
    cursor: not-allowed;
}

.button-area .bar.confirm-order:not(:disabled):hover {
    filter: brightness(0.9); /* 有効な状態でのホバー効果 */
}

@media screen and (max-width: 767px) {
.checkout-form div label,
.checkout-form div input,
.checkout-form div.long input,
textarea,
div.pay ul {
    width: 100% !important;
}
.checkout-form div input[type="radio"] {
    width: auto !important;
    margin-right: 10px;
}
div.pay ul{
    margin-top: 1rem;
}

}

.kanryo p{
text-align: center;
width: 100%;
padding: 1em;
box-sizing: border-box;
}

.empty-cart p{
    margin-bottom: 1rem;
}

/* --- Order Flow (shop.php) --- */
.order-flow {
    width: 100%;
    max-width: 900px;
    margin: 2em auto;
    padding: 1.5em;
    border: 2px dashed #eb6f8c;
    border-radius: 10px;
    background-color: #fffafb;
}

.order-flow h2 {
    text-align: center;
    margin-bottom: 1em;
    color: #eb6f8c;
    font-family: 'Noto Serif JP', serif;
}

.order-flow ol {
    list-style-type: none;
    padding-left: 0;
    counter-reset: order-flow-counter;
}

.order-flow ol li {
    position: relative;
    padding-left: 2.5em;
    margin-bottom: 1em;
    line-height: 1.6;
}

.order-flow ol li::before {
    counter-increment: order-flow-counter;
    content: counter(order-flow-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.8em;
    height: 1.8em;
    line-height: 1.8em;
    text-align: center;
    background-color: #eb6f8c;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.order-flow ol li strong {
    color: #d9534f; /* A shade of red */
    font-weight: bold;
}

/* --- Cart Page Buttons --- */
.cart-actions .bar, .btn-delete {
    padding: 0.5em 1em;
    font-size: 1.4rem;
    height: auto;
    margin-top: 0;
    margin-bottom: 0 !important;
}

.btn-delete {
    background-color: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}
.btn-delete:hover {
    background-color: #c9302c;
}


/* --- Cart Table Responsive --- */
@media screen and (max-width: 767px) {
    .cart-table {
        font-size: 1.2rem; /* Reduce font size */
    }
    .cart-table th, .cart-table td {
        padding: 4px;
    }
    .cart-table td:nth-child(2) { /* Product name column */
        min-width: 100px; /* Encourage wrapping */
    }
    .cart-table input[type="number"] {
        width: 40px !important;
    }
}

/* --- Category Title (shop.php) --- */
.category-title {
    width: 100%;
    text-align: center;
    font-size: 2.4rem;
    font-family: 'Noto Serif JP', serif;
    margin: 1em 0;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #f3a36e; /* Orange line */
    background: #FFF !important;
    color: #f3a36e !important; /* Orange text */
}

span.note{
    font-size: 0.8em;
    color: #b80000;
    display: block;
    margin-top: 0.5em;
}

.cart-table td:nth-of-type(4) input[type="number"]{
    text-align: center;
    font-size: 1.8rem;
    padding: 4px;
}
